@rspress/core 2.0.0-beta.20 → 2.0.0-beta.22

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/bin/rspress.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import nodeModule from 'node:module';
3
+
4
+ // enable on-disk code caching of all modules loaded by Node.js
5
+ // requires Nodejs >= 22.8.0
6
+ const { enableCompileCache } = nodeModule;
7
+ if (enableCompileCache) {
8
+ try {
9
+ enableCompileCache();
10
+ } catch {
11
+ // ignore errors
12
+ }
13
+ }
14
+
15
+ import('../dist/cli.js');
package/dist/208.js ADDED
@@ -0,0 +1,39 @@
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ export const __webpack_ids__ = [
4
+ "208"
5
+ ];
6
+ export const __webpack_modules__ = {
7
+ "./src/node/last-updated/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
+ __webpack_require__.d(__webpack_exports__, {
9
+ pluginLastUpdated: ()=>pluginLastUpdated
10
+ });
11
+ var execa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js");
12
+ function transform(timestamp, lang) {
13
+ return new Date(timestamp).toLocaleString(lang || 'zh');
14
+ }
15
+ async function getGitLastUpdatedTimeStamp(filePath) {
16
+ let lastUpdated;
17
+ try {
18
+ const { stdout } = await (0, execa__WEBPACK_IMPORTED_MODULE_0__.r)('git', [
19
+ 'log',
20
+ '-1',
21
+ '--format=%at',
22
+ filePath
23
+ ]);
24
+ lastUpdated = 1000 * Number(stdout);
25
+ } catch (_e) {}
26
+ return lastUpdated;
27
+ }
28
+ function pluginLastUpdated() {
29
+ return {
30
+ name: '@rspress/plugin-last-updated',
31
+ async extendPageData (pageData) {
32
+ const { _filepath, lang } = pageData;
33
+ const lastUpdated = await getGitLastUpdatedTimeStamp(_filepath);
34
+ if (lastUpdated) pageData.lastUpdatedTime = transform(lastUpdated, lang);
35
+ }
36
+ };
37
+ }
38
+ }
39
+ };
package/dist/309.js ADDED
@@ -0,0 +1,27 @@
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ export const __webpack_ids__ = [
4
+ "309"
5
+ ];
6
+ export const __webpack_modules__ = {
7
+ "./src/node/medium-zoom/index.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
+ __webpack_require__.d(__webpack_exports__, {
9
+ pluginMediumZoom: ()=>pluginMediumZoom
10
+ });
11
+ var node_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:path");
12
+ var node_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("node:url");
13
+ var _rspress_shared__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("@rspress/shared");
14
+ function pluginMediumZoom(options = {}) {
15
+ const __dirname = (0, _rspress_shared__WEBPACK_IMPORTED_MODULE_2__.normalizePosixPath)(node_path__WEBPACK_IMPORTED_MODULE_0__["default"].dirname((0, node_url__WEBPACK_IMPORTED_MODULE_1__.fileURLToPath)(import.meta.url)));
16
+ return {
17
+ name: '@rspress/plugin-medium-zoom',
18
+ globalUIComponents: [
19
+ [
20
+ node_path__WEBPACK_IMPORTED_MODULE_0__["default"].join(__dirname, '../static/MediumZoom.tsx'),
21
+ options
22
+ ]
23
+ ]
24
+ };
25
+ }
26
+ }
27
+ };