@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.
|
@@ -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,CA+Bb;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,33 @@ 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
|
+
cwd: repoRoot,
|
|
419
|
+
encoding: "utf-8",
|
|
420
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
421
|
+
}
|
|
422
|
+
).trim();
|
|
411
423
|
if (!result) {
|
|
412
424
|
return {};
|
|
413
425
|
}
|
|
@@ -3302,7 +3314,7 @@ function angularDemoPlugin({
|
|
|
3302
3314
|
return null;
|
|
3303
3315
|
}
|
|
3304
3316
|
const demoId = componentClass;
|
|
3305
|
-
const importPath =
|
|
3317
|
+
const importPath = relative2(process.cwd(), filePath).replace(/\\/g, "/");
|
|
3306
3318
|
const fileName = basename(filePath);
|
|
3307
3319
|
const importsWithoutStrip = stripImports(code, filePath);
|
|
3308
3320
|
const sourceCode = [];
|
|
@@ -3851,7 +3863,7 @@ var NODE_BUILTINS = [
|
|
|
3851
3863
|
import chalk5 from "chalk";
|
|
3852
3864
|
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
3853
3865
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
3854
|
-
import { dirname as dirname2, join as join3, relative as
|
|
3866
|
+
import { dirname as dirname2, join as join3, relative as relative3, resolve as resolve3, sep } from "node:path";
|
|
3855
3867
|
import * as ts2 from "typescript";
|
|
3856
3868
|
import { pascalCase } from "@qualcomm-ui/utils/change-case";
|
|
3857
3869
|
function createDemoName(filePath) {
|
|
@@ -4125,7 +4137,7 @@ function resolvePathAlias2(source, pathAliases) {
|
|
|
4125
4137
|
return null;
|
|
4126
4138
|
}
|
|
4127
4139
|
function extractPageId(filePath, routesDir) {
|
|
4128
|
-
const relativePath =
|
|
4140
|
+
const relativePath = relative3(routesDir, filePath);
|
|
4129
4141
|
const pathParts = relativePath.split(sep);
|
|
4130
4142
|
if (pathParts.includes("demos")) {
|
|
4131
4143
|
const demosIndex = pathParts.indexOf("demos");
|