@xrmforge/typegen 0.11.0 → 0.11.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/dist/index.js CHANGED
@@ -2569,11 +2569,14 @@ function groupCustomApis(apis) {
2569
2569
  // src/orchestrator/file-writer.ts
2570
2570
  import { mkdir, writeFile, readFile, unlink, readdir, access } from "fs/promises";
2571
2571
  import { join as join2, dirname } from "path";
2572
+ function normalizeLineEndings(content) {
2573
+ return content.replace(/\r\n?/g, "\n");
2574
+ }
2572
2575
  async function writeGeneratedFile(outputDir, file) {
2573
2576
  const absolutePath = join2(outputDir, file.relativePath);
2574
2577
  try {
2575
2578
  const existing = await readFile(absolutePath, "utf-8");
2576
- if (existing === file.content) {
2579
+ if (normalizeLineEndings(existing) === normalizeLineEndings(file.content)) {
2577
2580
  return false;
2578
2581
  }
2579
2582
  } catch {
@@ -2630,7 +2633,7 @@ async function checkGeneratedFile(outputDir, file) {
2630
2633
  const absolutePath = join2(outputDir, file.relativePath);
2631
2634
  try {
2632
2635
  const existing = await readFile(absolutePath, "utf-8");
2633
- return existing === file.content ? "unchanged" : "changed";
2636
+ return normalizeLineEndings(existing) === normalizeLineEndings(file.content) ? "unchanged" : "changed";
2634
2637
  } catch (error) {
2635
2638
  if (error.code === "ENOENT") {
2636
2639
  return "missing";