@rspress/shared 1.20.0 → 1.21.0

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.d.ts CHANGED
@@ -584,7 +584,10 @@ interface Hero {
584
584
  text: string;
585
585
  tagline: string;
586
586
  image?: {
587
- src: string;
587
+ src: string | {
588
+ dark: string;
589
+ light: string;
590
+ };
588
591
  alt: string;
589
592
  /**
590
593
  * `srcset` and `sizes` are attributes of `<img>` tag. Please refer to https://mdn.io/srcset for the usage.
@@ -728,7 +731,7 @@ declare const MDX_REGEXP: RegExp;
728
731
  declare const APPEARANCE_KEY = "rspress-theme-appearance";
729
732
  declare const SEARCH_INDEX_NAME = "search_index";
730
733
  declare const RSPRESS_TEMP_DIR = ".rspress";
731
- declare const DEFAULT_HIGHLIGHT_LANGUAGES: (string | string[])[];
734
+ declare const DEFAULT_HIGHLIGHT_LANGUAGES: string[][];
732
735
  declare const isSCM: () => boolean;
733
736
  declare const isProduction: () => boolean;
734
737
  declare const isDebugMode: () => boolean;
package/dist/index.js CHANGED
@@ -1122,17 +1122,9 @@ var DEFAULT_HIGHLIGHT_LANGUAGES = [
1122
1122
  ["js", "javascript"],
1123
1123
  ["ts", "typescript"],
1124
1124
  ["jsx", "tsx"],
1125
- "tsx",
1126
- "json",
1127
- "css",
1128
- "scss",
1129
- "less",
1130
1125
  ["xml", "xml-doc"],
1131
- "diff",
1132
- "yaml",
1133
1126
  ["md", "markdown"],
1134
- ["mdx", "tsx"],
1135
- "bash"
1127
+ ["mdx", "tsx"]
1136
1128
  ];
1137
1129
  var isSCM = () => Boolean(process.env.BUILD_VERSION);
1138
1130
  var isProduction = () => process.env.NODE_ENV === "production";
package/dist/index.mjs CHANGED
@@ -1064,17 +1064,9 @@ var DEFAULT_HIGHLIGHT_LANGUAGES = [
1064
1064
  ["js", "javascript"],
1065
1065
  ["ts", "typescript"],
1066
1066
  ["jsx", "tsx"],
1067
- "tsx",
1068
- "json",
1069
- "css",
1070
- "scss",
1071
- "less",
1072
1067
  ["xml", "xml-doc"],
1073
- "diff",
1074
- "yaml",
1075
1068
  ["md", "markdown"],
1076
- ["mdx", "tsx"],
1077
- "bash"
1069
+ ["mdx", "tsx"]
1078
1070
  ];
1079
1071
  var isSCM = () => Boolean(process.env.BUILD_VERSION);
1080
1072
  var isProduction = () => process.env.NODE_ENV === "production";
@@ -43,10 +43,10 @@ var import_core = require("@rsbuild/core");
43
43
 
44
44
  // src/node-utils/loadFrontMatter.ts
45
45
  function loadFrontMatter(source, filepath, root, outputWarning = false) {
46
- let frontmatter = {};
47
46
  let content = "";
47
+ let frontmatter = {};
48
48
  try {
49
- ({ data: frontmatter, content } = (0, import_gray_matter.default)(source));
49
+ ({ content, data: frontmatter } = (0, import_gray_matter.default)(source));
50
50
  } catch (e) {
51
51
  if (outputWarning) {
52
52
  import_core.logger.warn(
@@ -7,10 +7,10 @@ import { logger } from "@rsbuild/core";
7
7
 
8
8
  // src/node-utils/loadFrontMatter.ts
9
9
  function loadFrontMatter(source, filepath, root, outputWarning = false) {
10
- let frontmatter = {};
11
10
  let content = "";
11
+ let frontmatter = {};
12
12
  try {
13
- ({ data: frontmatter, content } = grayMatter(source));
13
+ ({ content, data: frontmatter } = grayMatter(source));
14
14
  } catch (e) {
15
15
  if (outputWarning) {
16
16
  logger.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -42,7 +42,7 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@rsbuild/core": "0.6.12",
45
+ "@rsbuild/core": "0.6.13",
46
46
  "unified": "^10.1.2",
47
47
  "chalk": "4.1.2",
48
48
  "execa": "5.1.1",