sizuku 0.6.2 → 0.6.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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -16
  2. package/package.json +1 -2
package/dist/index.mjs CHANGED
@@ -799,42 +799,42 @@ Options:
799
799
  --no-with-comment Do not add JSDoc comments
800
800
  --no-with-relation Do not generate relation schemas
801
801
  -h, --help Display this help message`;
802
- function parseFlags(argv) {
802
+ function parseFlags(args) {
803
803
  const ZOD_VERSIONS = [
804
804
  "v4",
805
805
  "mini",
806
806
  "@hono/zod-openapi"
807
807
  ];
808
- const zodVersionIndex = argv.findIndex((a) => a === "--zod-version" || a.startsWith("--zod-version="));
809
- const zodVersionValue = zodVersionIndex === -1 ? void 0 : argv[zodVersionIndex].includes("=") ? argv[zodVersionIndex].split("=")[1] : argv[zodVersionIndex + 1];
808
+ const zodVersionIndex = args.findIndex((a) => a === "--zod-version" || a.startsWith("--zod-version="));
809
+ const zodVersionValue = zodVersionIndex === -1 ? void 0 : args[zodVersionIndex].includes("=") ? args[zodVersionIndex].split("=")[1] : args[zodVersionIndex + 1];
810
810
  return {
811
- zod: argv.includes("--zod"),
812
- valibot: argv.includes("--valibot"),
813
- arktype: argv.includes("--arktype"),
814
- effect: argv.includes("--effect"),
811
+ zod: args.includes("--zod"),
812
+ valibot: args.includes("--valibot"),
813
+ arktype: args.includes("--arktype"),
814
+ effect: args.includes("--effect"),
815
815
  zodVersion: ZOD_VERSIONS.find((v) => v === zodVersionValue),
816
- exportTypes: !argv.includes("--no-export-types"),
817
- withComment: !argv.includes("--no-with-comment"),
818
- withRelation: !argv.includes("--no-with-relation")
816
+ exportTypes: !args.includes("--no-export-types"),
817
+ withComment: !args.includes("--no-with-comment"),
818
+ withRelation: !args.includes("--no-with-relation")
819
819
  };
820
820
  }
821
821
  async function sizuku() {
822
- const argv = process.argv.slice(2);
823
- if (argv.length === 0 || argv.includes("--help") || argv.includes("-h")) return {
822
+ const args = process.argv.slice(2);
823
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) return {
824
824
  ok: true,
825
825
  value: HELP_TEXT
826
826
  };
827
- const input = argv[0];
827
+ const input = args[0];
828
828
  if (!input || input.startsWith("-")) return {
829
829
  ok: false,
830
830
  error: HELP_TEXT
831
831
  };
832
- const oIndex = argv.indexOf("-o");
832
+ const oIndex = args.indexOf("-o");
833
833
  if (oIndex === -1) return {
834
834
  ok: false,
835
835
  error: "Missing -o flag. Usage: sizuku <input> -o <output>"
836
836
  };
837
- const output = argv[oIndex + 1];
837
+ const output = args[oIndex + 1];
838
838
  if (!output) return {
839
839
  ok: false,
840
840
  error: "Missing output file path after -o"
@@ -844,7 +844,7 @@ async function sizuku() {
844
844
  ok: false,
845
845
  error: `Unsupported output format: ${output}. Supported: .dbml, .png, .md, .ts`
846
846
  };
847
- const flags = outputType === "typescript" ? parseFlags(argv) : null;
847
+ const flags = outputType === "typescript" ? parseFlags(args) : null;
848
848
  const lib = flags === null ? null : flags.zod ? {
849
849
  name: "zod",
850
850
  label: "Zod"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sizuku",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Sizuku is a tool that generates validation schemas for Zod and Valibot, as well as ER diagrams and DBML, from Drizzle schemas annotated with comments.",
5
5
  "keywords": [
6
6
  "dbml",
@@ -27,7 +27,6 @@
27
27
  "type": "module",
28
28
  "main": "dist/index.mjs",
29
29
  "types": "dist/index.d.mts",
30
- "exports": {},
31
30
  "publishConfig": {
32
31
  "access": "public"
33
32
  },