@qualcomm-ui/mdx-vite 2.6.0 → 2.6.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/cli.js CHANGED
@@ -3876,21 +3876,33 @@ 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
+ cwd: repoRoot,
3902
+ encoding: "utf-8",
3903
+ stdio: ["pipe", "pipe", "pipe"]
3904
+ }
3905
+ ).trim();
3894
3906
  if (!result) {
3895
3907
  return {};
3896
3908
  }
@@ -6937,11 +6949,11 @@ import { dedent as dedent2 } from "@qualcomm-ui/utils/dedent";
6937
6949
  // src/react-demo-plugin/demo-plugin-utils.ts
6938
6950
  import chalk4 from "chalk";
6939
6951
  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";
6952
+ import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve7, sep } from "node:path";
6941
6953
  import * as ts from "typescript";
6942
6954
  import { pascalCase } from "@qualcomm-ui/utils/change-case";
6943
6955
  function extractPageId(filePath, routesDir) {
6944
- const relativePath = relative(routesDir, filePath);
6956
+ const relativePath = relative2(routesDir, filePath);
6945
6957
  const pathParts = relativePath.split(sep);
6946
6958
  if (pathParts.includes("demos")) {
6947
6959
  const demosIndex = pathParts.indexOf("demos");