@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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-file-reader.d.ts","sourceRoot":"","sources":["../../../../../src/docs-plugin/internal/services/markdown/markdown-file-reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-file-reader.d.ts","sourceRoot":"","sources":["../../../../../src/docs-plugin/internal/services/markdown/markdown-file-reader.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAA;AAE7D,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,gBAAgB,CAAA;AAG7D,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAEjE,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,yBAAyB,GAC9B,WAAW,CA8Bb;AAED,UAAU,SAAS;IACjB,WAAW,EAAE,eAAe,CAAA;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,WAAW,CAAA;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAC1C,mBAAmB,EAAE,cAAc,EAAE,CAAA;CACtC;AAED,qBAAa,kBAAkB;IAMpB,OAAO,EAAE,OAAO;IAChB,qBAAqB,EAAE,yBAAyB;IANzD,eAAe,SAAI;IACnB,WAAW,UAAO;IAClB,OAAO,CAAC,QAAQ,CAAgC;gBAGvC,OAAO,EAAE,OAAO,EAChB,qBAAqB,GAAE,yBAAiC;IAGjE,OAAO,CAAC,IAAI;IAIZ,KAAK,IAAI,IAAI;IAIb,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI7C,OAAO,CAAC,UAAU;IAyBlB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG;QAC1B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,SAAS,CAAA;QAC1C,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,eAAe,CAAA;KAC7B;IAiED,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,GAChC,IAAI;CAKR"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { watch } from "chokidar";
|
|
|
6
6
|
import { glob as glob2 } from "glob";
|
|
7
7
|
import { existsSync } from "node:fs";
|
|
8
8
|
import { readFile as readFile2, stat } from "node:fs/promises";
|
|
9
|
-
import { basename, dirname, join as join2, relative, resolve as resolve2 } from "node:path";
|
|
9
|
+
import { basename, dirname, join as join2, relative as relative2, resolve as resolve2 } from "node:path";
|
|
10
10
|
import {
|
|
11
11
|
createHighlighter
|
|
12
12
|
} from "shiki";
|
|
@@ -393,21 +393,32 @@ import chalk from "chalk";
|
|
|
393
393
|
import { execSync } from "node:child_process";
|
|
394
394
|
import { createHash } from "node:crypto";
|
|
395
395
|
import { readFileSync } from "node:fs";
|
|
396
|
+
import { relative } from "node:path";
|
|
396
397
|
import remarkFrontmatter from "remark-frontmatter";
|
|
397
398
|
import remarkParse2 from "remark-parse";
|
|
398
399
|
import remarkParseFrontmatter from "remark-parse-frontmatter";
|
|
399
400
|
import remarkStringify2 from "remark-stringify";
|
|
400
401
|
import { unified as unified2 } from "unified";
|
|
402
|
+
function getRepoRoot() {
|
|
403
|
+
return execSync("git rev-parse --show-toplevel", {
|
|
404
|
+
encoding: "utf-8"
|
|
405
|
+
}).trim();
|
|
406
|
+
}
|
|
401
407
|
function getGitMetadata(filePath, mode) {
|
|
402
408
|
if (mode === "off") {
|
|
403
409
|
return {};
|
|
404
410
|
}
|
|
405
411
|
try {
|
|
412
|
+
const repoRoot = getRepoRoot();
|
|
413
|
+
const relativePath = relative(repoRoot, filePath);
|
|
406
414
|
const format = mode === "user-and-timestamp" ? "%cI%n%aN" : "%cI";
|
|
407
|
-
const result = execSync(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
415
|
+
const result = execSync(
|
|
416
|
+
`git log -1 --format=${format} -- "${relativePath}"`,
|
|
417
|
+
{
|
|
418
|
+
encoding: "utf-8",
|
|
419
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
420
|
+
}
|
|
421
|
+
).trim();
|
|
411
422
|
if (!result) {
|
|
412
423
|
return {};
|
|
413
424
|
}
|
|
@@ -3302,7 +3313,7 @@ function angularDemoPlugin({
|
|
|
3302
3313
|
return null;
|
|
3303
3314
|
}
|
|
3304
3315
|
const demoId = componentClass;
|
|
3305
|
-
const importPath =
|
|
3316
|
+
const importPath = relative2(process.cwd(), filePath).replace(/\\/g, "/");
|
|
3306
3317
|
const fileName = basename(filePath);
|
|
3307
3318
|
const importsWithoutStrip = stripImports(code, filePath);
|
|
3308
3319
|
const sourceCode = [];
|
|
@@ -3851,7 +3862,7 @@ var NODE_BUILTINS = [
|
|
|
3851
3862
|
import chalk5 from "chalk";
|
|
3852
3863
|
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
3853
3864
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
3854
|
-
import { dirname as dirname2, join as join3, relative as
|
|
3865
|
+
import { dirname as dirname2, join as join3, relative as relative3, resolve as resolve3, sep } from "node:path";
|
|
3855
3866
|
import * as ts2 from "typescript";
|
|
3856
3867
|
import { pascalCase } from "@qualcomm-ui/utils/change-case";
|
|
3857
3868
|
function createDemoName(filePath) {
|
|
@@ -4125,7 +4136,7 @@ function resolvePathAlias2(source, pathAliases) {
|
|
|
4125
4136
|
return null;
|
|
4126
4137
|
}
|
|
4127
4138
|
function extractPageId(filePath, routesDir) {
|
|
4128
|
-
const relativePath =
|
|
4139
|
+
const relativePath = relative3(routesDir, filePath);
|
|
4129
4140
|
const pathParts = relativePath.split(sep);
|
|
4130
4141
|
if (pathParts.includes("demos")) {
|
|
4131
4142
|
const demosIndex = pathParts.indexOf("demos");
|