@rspress/plugin-preview 0.0.0-next-20230816082004 → 0.0.0-next-20230912055100

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Rspress
3
+ Copyright (c) 2023-present Bytedance, Inc. and its affiliates.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -2415,9 +2415,9 @@ var require_lib = __commonJS({
2415
2415
  }
2416
2416
  });
2417
2417
 
2418
- // ../../node_modules/.pnpm/rspack-plugin-virtual-module@0.1.8/node_modules/rspack-plugin-virtual-module/dist/index.js
2418
+ // ../../node_modules/.pnpm/rspack-plugin-virtual-module@0.1.11/node_modules/rspack-plugin-virtual-module/dist/index.js
2419
2419
  var require_dist = __commonJS({
2420
- "../../node_modules/.pnpm/rspack-plugin-virtual-module@0.1.8/node_modules/rspack-plugin-virtual-module/dist/index.js"(exports) {
2420
+ "../../node_modules/.pnpm/rspack-plugin-virtual-module@0.1.11/node_modules/rspack-plugin-virtual-module/dist/index.js"(exports) {
2421
2421
  "use strict";
2422
2422
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
2423
2423
  if (k2 === void 0)
@@ -2489,9 +2489,11 @@ var require_dist = __commonJS({
2489
2489
  if (!fs_extra_1.default.existsSync(nodeModulesDir)) {
2490
2490
  fs_extra_1.default.mkdirSync(nodeModulesDir);
2491
2491
  }
2492
- const hash = crypto_1.default.createHash("md4").update(JSON.stringify(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_staticModules, "f"))).digest("hex").slice(0, 8);
2492
+ const hash = crypto_1.default.createHash("md5").update(JSON.stringify(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_staticModules, "f"))).digest("hex").slice(0, 8);
2493
2493
  __classPrivateFieldSet(this, _RspackVirtualModulePlugin_tempDir, path_1.default.join(nodeModulesDir, `rspack-virtual-module-${hash}`), "f");
2494
- fs_extra_1.default.mkdirSync(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_tempDir, "f"));
2494
+ if (!fs_extra_1.default.existsSync(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_tempDir, "f"))) {
2495
+ fs_extra_1.default.mkdirSync(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_tempDir, "f"));
2496
+ }
2495
2497
  }
2496
2498
  apply(compiler) {
2497
2499
  Object.entries(__classPrivateFieldGet(this, _RspackVirtualModulePlugin_staticModules, "f")).forEach(([path3, content]) => {
@@ -2767,11 +2769,13 @@ __export(src_exports, {
2767
2769
  module.exports = __toCommonJS(src_exports);
2768
2770
  var import_path3 = __toESM(require("path"));
2769
2771
  var import_rspack_plugin_virtual_module = __toESM(require_dist());
2772
+ var import_shared2 = require("@rspress/shared");
2770
2773
 
2771
2774
  // src/codeToDemo.ts
2772
2775
  var import_path2 = require("path");
2773
2776
  init_unist_util_visit();
2774
2777
  var import_fs_extra = __toESM(require("@modern-js/utils/fs-extra"));
2778
+ var import_shared = require("@rspress/shared");
2775
2779
 
2776
2780
  // src/utils.ts
2777
2781
  var toValidVarName = (str) => {
@@ -2893,7 +2897,7 @@ var remarkCodeToDemo = ({ isMobile, getRouteMeta, iframePosition }) => {
2893
2897
  const demoDir = (0, import_path2.join)(
2894
2898
  process.cwd(),
2895
2899
  "node_modules",
2896
- ".modern-doc",
2900
+ import_shared.RSPRESS_TEMP_DIR,
2897
2901
  `virtual-demo`
2898
2902
  );
2899
2903
  const id = `${toValidVarName(pageName)}_${index++}`;
@@ -3081,7 +3085,7 @@ import Demo from ${JSON.stringify(demoComponentPath)}
3081
3085
  const demoDir = (0, import_path3.join)(
3082
3086
  process.cwd(),
3083
3087
  "node_modules",
3084
- ".modern-doc",
3088
+ import_shared2.RSPRESS_TEMP_DIR,
3085
3089
  `virtual-demo`
3086
3090
  );
3087
3091
  const virtualModulePath = (0, import_path3.join)(demoDir, `${id}.tsx`);