warframe-public-export-plus 0.6.1 → 0.6.2

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.
@@ -11,33 +11,32 @@ for (const line of indexTypes.split(/\r?\n/)) {
11
11
  }
12
12
  types += "\n}";
13
13
 
14
- console.log("🕐 Generating schemas...");
14
+ console.log("Generating schemas...");
15
15
  fs.writeFileSync("tmp-types.ts", types);
16
- execSync("npx ts-to-zod tmp-types.ts tmp-schemas.ts --skipValidation", {
17
- stdio: "inherit",
18
- });
16
+ execSync("npx ts-to-zod tmp-types.ts tmp-schemas.js --skipValidation");
19
17
 
20
18
  const schemas = fs
21
- .readFileSync("tmp-schemas.ts", "utf8")
22
- .replace(/z\.object/g, "z.strictObject")
23
- .replace("iAbilitySchema = z.strictObject({", "iAbilitySchema = z.object({");
24
- fs.writeFileSync("tmp-schemas.ts", schemas);
19
+ .readFileSync("tmp-schemas.js", "utf8")
20
+ .replaceAll("z.object", "z.strictObject")
21
+ .replace("iAbilitySchema = z.strictObject({", "iAbilitySchema = z.object({")
22
+ .replace("z.record(tMissionTypeSchema, iTilesetMissionSchema).partial()", "z.partialRecord(tMissionTypeSchema, iTilesetMissionSchema)");
23
+ fs.writeFileSync("tmp-schemas.mjs", schemas);
25
24
 
26
- console.log("🕐 Validating schemas...");
25
+ console.log("Validating schemas...");
27
26
  const test = `import { z } from "zod";
28
- import { iPublicExportPlusSchema } from "./tmp-schemas";
29
- import publicExportPlus from "./index";
27
+ import { iPublicExportPlusSchema } from "./tmp-schemas.mjs";
28
+ import publicExportPlus from "./index.js";
30
29
  try {
31
30
  iPublicExportPlusSchema.parse(publicExportPlus);
32
- console.log("Schemas validated successfully.");
31
+ console.log("Schemas validated successfully.");
33
32
  } catch (e) {
34
- console.error((e as Error).message);
33
+ console.error(e.message);
35
34
  process.exit(1);
36
35
  }`;
37
- fs.writeFileSync("tmp-test.ts", test);
36
+ fs.writeFileSync("tmp-test.mjs", test);
38
37
 
39
38
  try {
40
- execSync("npx ts-node tmp-test.ts", {
39
+ execSync("node tmp-test.mjs", {
41
40
  stdio: "inherit",
42
41
  env: {
43
42
  ...process.env,
@@ -51,7 +50,8 @@ try {
51
50
  process.exitCode = 1;
52
51
  }
53
52
  } finally {
54
- fs.unlinkSync("tmp-schemas.ts");
55
53
  fs.unlinkSync("tmp-types.ts");
56
- fs.unlinkSync("tmp-test.ts");
54
+ fs.unlinkSync("tmp-schemas.mjs");
55
+ fs.unlinkSync("tmp-schemas.js");
56
+ fs.unlinkSync("tmp-test.mjs");
57
57
  }