@qualcomm-ui/mdx-vite 2.6.0 → 2.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.
package/dist/cli.js CHANGED
@@ -3876,21 +3876,32 @@ import chalk from "chalk";
3876
3876
  import { execSync } from "node:child_process";
3877
3877
  import { createHash } from "node:crypto";
3878
3878
  import { readFileSync } from "node:fs";
3879
+ import { relative } from "node:path";
3879
3880
  import remarkFrontmatter from "remark-frontmatter";
3880
3881
  import remarkParse2 from "remark-parse";
3881
3882
  import remarkParseFrontmatter from "remark-parse-frontmatter";
3882
3883
  import remarkStringify2 from "remark-stringify";
3883
3884
  import { unified as unified2 } from "unified";
3885
+ function getRepoRoot() {
3886
+ return execSync("git rev-parse --show-toplevel", {
3887
+ encoding: "utf-8"
3888
+ }).trim();
3889
+ }
3884
3890
  function getGitMetadata(filePath, mode) {
3885
3891
  if (mode === "off") {
3886
3892
  return {};
3887
3893
  }
3888
3894
  try {
3895
+ const repoRoot = getRepoRoot();
3896
+ const relativePath = relative(repoRoot, filePath);
3889
3897
  const format = mode === "user-and-timestamp" ? "%cI%n%aN" : "%cI";
3890
- const result = execSync(`git log -1 --format=${format} -- "${filePath}"`, {
3891
- encoding: "utf-8",
3892
- stdio: ["pipe", "pipe", "pipe"]
3893
- }).trim();
3898
+ const result = execSync(
3899
+ `git log -1 --format=${format} -- "${relativePath}"`,
3900
+ {
3901
+ encoding: "utf-8",
3902
+ stdio: ["pipe", "pipe", "pipe"]
3903
+ }
3904
+ ).trim();
3894
3905
  if (!result) {
3895
3906
  return {};
3896
3907
  }
@@ -6937,11 +6948,11 @@ import { dedent as dedent2 } from "@qualcomm-ui/utils/dedent";
6937
6948
  // src/react-demo-plugin/demo-plugin-utils.ts
6938
6949
  import chalk4 from "chalk";
6939
6950
  import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
6940
- import { dirname as dirname2, join as join4, relative, resolve as resolve7, sep } from "node:path";
6951
+ import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve7, sep } from "node:path";
6941
6952
  import * as ts from "typescript";
6942
6953
  import { pascalCase } from "@qualcomm-ui/utils/change-case";
6943
6954
  function extractPageId(filePath, routesDir) {
6944
- const relativePath = relative(routesDir, filePath);
6955
+ const relativePath = relative2(routesDir, filePath);
6945
6956
  const pathParts = relativePath.split(sep);
6946
6957
  if (pathParts.includes("demos")) {
6947
6958
  const demosIndex = pathParts.indexOf("demos");