@rspress/core 0.0.6 → 0.0.8

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.js CHANGED
@@ -63,6 +63,15 @@ var tailwindConfig = {
63
63
  4: "var(--rp-c-gray-light-4)",
64
64
  5: "var(--rp-c-gray-light-5)"
65
65
  }
66
+ },
67
+ dark: {
68
+ light: {
69
+ 1: "var(--rp-c-dark-light-1)",
70
+ 2: "var(--rp-c-dark-light-2)",
71
+ 3: "var(--rp-c-dark-light-3)",
72
+ 4: "var(--rp-c-dark-light-4)",
73
+ 5: "var(--rp-c-dark-light-5)"
74
+ }
66
75
  }
67
76
  }
68
77
  }
@@ -77,8 +86,8 @@ var isProduction = () => process.env.NODE_ENV === "production";
77
86
  var importStatementRegex = /import\s+(.*?)\s+from\s+['"](.*?)['"];?/gm;
78
87
  var dirname = path.dirname(fileURLToPath(new URL(import.meta.url)));
79
88
  var PACKAGE_ROOT = path.join(dirname, "..");
80
- var CLIENT_ENTRY = path.join(PACKAGE_ROOT, "src", "runtime", "clientEntry.tsx");
81
- var SSR_ENTRY = path.join(PACKAGE_ROOT, "src", "runtime", "ssrEntry.tsx");
89
+ var CLIENT_ENTRY = path.join(PACKAGE_ROOT, "dist", "runtime", "clientEntry.js");
90
+ var SSR_ENTRY = path.join(PACKAGE_ROOT, "dist", "runtime", "ssrEntry.js");
82
91
  var OUTPUT_DIR = "doc_build";
83
92
  var APP_HTML_MARKER = "<!--<?- DOC_CONTENT ?>-->";
84
93
  var HEAD_MARKER = "<!--<?- HEAD ?>-->";
@@ -129,8 +138,8 @@ var RuntimeModulesPlugin = class {
129
138
  fs.writeFileSync(_class_private_method_get(this, _normalizePath, normalizePath).call(this, path10), content);
130
139
  });
131
140
  }
132
- writeModule(path1, content) {
133
- const normalizedPath = _class_private_method_get(this, _normalizePath, normalizePath).call(this, path1);
141
+ writeModule(path10, content) {
142
+ const normalizedPath = _class_private_method_get(this, _normalizePath, normalizePath).call(this, path10);
134
143
  this.staticModules[normalizedPath] = content;
135
144
  fs.writeFileSync(normalizedPath, content);
136
145
  }
@@ -648,7 +657,6 @@ async function globalStylesVMPlugin(context) {
648
657
  const styleContent = await fs5.readFile(source, "utf-8");
649
658
  const patchedStyleContent = styleContent.replace(/--modern-/g, "--rp-").replace(/\.modern-doc/g, ".rspress").replace(/\.modern-/g, ".rspress-");
650
659
  await fs5.writeFile(source, patchedStyleContent, "utf-8");
651
- console.log(`[globalStylesVMPlugin] patched ${source}`);
652
660
  return `import ${JSON.stringify(source)};`;
653
661
  }))).join("");
654
662
  return new RuntimeModulesPlugin({
@@ -1067,15 +1075,15 @@ async function initRouteService(options) {
1067
1075
  var require4 = createRequire3(import.meta.url);
1068
1076
  async function createInternalBuildConfig(userRoot, config, isSSR, runtimeTempDir, routeService2) {
1069
1077
  const cwd = process.cwd();
1070
- const { default: fs1 } = await import("@modern-js/utils/fs-extra");
1078
+ const { default: fs12 } = await import("@modern-js/utils/fs-extra");
1071
1079
  const CUSTOM_THEME_DIR = config?.themeDir ?? path9.join(process.cwd(), "theme");
1072
1080
  const outDir = config?.outDir ?? OUTPUT_DIR;
1073
1081
  const DEFAULT_THEME_DIR = isDebugMode() ? path9.join(PACKAGE_ROOT, "src", "theme-default") : path9.join(PACKAGE_ROOT, "dist", "theme");
1074
- const themeDir = await fs1.pathExists(CUSTOM_THEME_DIR) ? CUSTOM_THEME_DIR : DEFAULT_THEME_DIR;
1082
+ const themeDir = await fs12.pathExists(CUSTOM_THEME_DIR) ? CUSTOM_THEME_DIR : DEFAULT_THEME_DIR;
1075
1083
  const checkDeadLinks = (config?.markdown?.checkDeadLinks && !isSSR) ?? false;
1076
1084
  const base = config?.base ?? "";
1077
1085
  const publicDir = path9.join(userRoot, "public");
1078
- const isPublicDirExist = await fs1.pathExists(publicDir);
1086
+ const isPublicDirExist = await fs12.pathExists(publicDir);
1079
1087
  const assetPrefix = isProduction() ? removeTrailingSlash(config?.builderConfig?.output?.assetPrefix ?? base) : "";
1080
1088
  const enableMdxRs = config?.markdown?.experimentalMdxRs ?? false;
1081
1089
  const reactVersion = await detectReactVersion();
@@ -1121,8 +1129,7 @@ async function createInternalBuildConfig(userRoot, config, isSSR, runtimeTempDir
1121
1129
  source: {
1122
1130
  alias: {
1123
1131
  "@mdx-js/react": require4.resolve("@mdx-js/react"),
1124
- "@": path9.join(PACKAGE_ROOT, "src"),
1125
- "@/runtime": path9.join(PACKAGE_ROOT, "src", "runtime", "index.ts"),
1132
+ "@/runtime": path9.join(PACKAGE_ROOT, "dist", "runtime"),
1126
1133
  "@theme": themeDir,
1127
1134
  "@rspress/core": PACKAGE_ROOT,
1128
1135
  "react-lazy-with-preload": require4.resolve("react-lazy-with-preload"),
@@ -1395,7 +1402,6 @@ async function dev(options) {
1395
1402
  }));
1396
1403
  },
1397
1404
  // We will support the following options in the future
1398
- // @ts-expect-error
1399
1405
  getPortSilently: true,
1400
1406
  logger: options.logger
1401
1407
  });