rspress 2.0.0-beta.20 → 2.0.0-beta.21

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.
@@ -0,0 +1,7 @@
1
+ import type { UserConfig } from '@rspress/core';
2
+
3
+ export declare function defineConfig(config: UserConfig): UserConfig;
4
+
5
+ export { UserConfig }
6
+
7
+ export { }
package/dist/config.js ADDED
@@ -0,0 +1,4 @@
1
+ function defineConfig(config) {
2
+ return config;
3
+ }
4
+ export { defineConfig };
package/dist/core.d.ts ADDED
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@rspress/core/dist/index.js";
3
+
4
+ export { }
package/dist/core.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@rspress/core/dist/index.js";
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import node_path from "node:path";
2
- import { build, dev, serve } from "@rspress/core";
3
- import { logger } from "@rspress/shared/logger";
2
+ import { build, dev, logger, serve } from "@rspress/core";
3
+ import { logger as logger_logger } from "@rspress/shared/logger";
4
4
  import { cac } from "cac";
5
5
  import chokidar from "chokidar";
6
6
  import picocolors from "picocolors";
7
7
  import node_fs from "node:fs";
8
8
  import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
9
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.20"}');
9
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.21"}');
10
10
  const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
11
11
  async function loadConfigFile(customConfigFile) {
12
12
  const baseDir = process.cwd();
@@ -38,10 +38,13 @@ const CONFIG_FILES = [
38
38
  'rspress.config.ts',
39
39
  'rspress.config.js'
40
40
  ];
41
- const META_FILE = '_meta.json';
41
+ const META_FILES = [
42
+ '_meta.json',
43
+ '_nav.json'
44
+ ];
42
45
  const cli = cac('rspress').version(package_namespaceObject.i8).help();
43
46
  const landingMessage = `\u{1F525} Rspress v${package_namespaceObject.i8}\n`;
44
- logger.greet(landingMessage);
47
+ logger_logger.greet(landingMessage);
45
48
  const setNodeEnv = (env)=>{
46
49
  process.env.NODE_ENV = env;
47
50
  };
@@ -81,7 +84,8 @@ cli.command('[root]', 'start dev server').alias('dev').option('--port [port]', '
81
84
  ]
82
85
  });
83
86
  cliWatcher.on('all', async (eventName, filepath)=>{
84
- if ('add' === eventName || 'unlink' === eventName || 'change' === eventName && (CONFIG_FILES.includes(node_path.basename(filepath)) || node_path.basename(filepath) === META_FILE)) {
87
+ const basename = node_path.basename(filepath);
88
+ if ('add' === eventName || 'unlink' === eventName || 'change' === eventName && (CONFIG_FILES.includes(basename) || META_FILES.includes(basename))) {
85
89
  if (isRestarting) return;
86
90
  isRestarting = true;
87
91
  console.log(`
@@ -118,7 +122,7 @@ cli.command('build [root]').action(async (root, options)=>{
118
122
  configFilePath
119
123
  });
120
124
  } catch (err) {
121
- logger.error(err);
125
+ logger_logger.error(err);
122
126
  process.exit(1);
123
127
  }
124
128
  });
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@rspress/core/dist/runtime.js";
3
+
4
+ export { }
@@ -0,0 +1 @@
1
+ export * from "@rspress/core/dist/runtime.js";
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@rspress/core/dist/shiki-transformers.js";
3
+
4
+ export { }
@@ -0,0 +1 @@
1
+ export * from "@rspress/core/dist/shiki-transformers.js";
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@rspress/core/dist/theme.js";
3
+
4
+ export { }
package/dist/theme.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@rspress/core/dist/theme.js";
@@ -157,12 +157,17 @@
157
157
  },
158
158
  "tag": {
159
159
  "type": "string"
160
+ },
161
+ "items": {
162
+ "type": "array",
163
+ "items": {
164
+ "$ref": "#/definitions/CustomLinkMeta"
165
+ }
160
166
  }
161
167
  },
162
168
  "required": [
163
169
  "type",
164
- "label",
165
- "link"
170
+ "label"
166
171
  ],
167
172
  "additionalProperties": false
168
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress",
3
- "version": "2.0.0-beta.20",
3
+ "version": "2.0.0-beta.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/web-infra-dev/rspress.git",
@@ -10,19 +10,28 @@
10
10
  "type": "module",
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/index.d.ts",
13
14
  "default": "./dist/index.js"
14
15
  },
16
+ "./core": {
17
+ "types": "./dist/core.d.ts",
18
+ "default": "./dist/core.js"
19
+ },
15
20
  "./runtime": {
16
- "default": "./runtime.ts"
21
+ "types": "./dist/runtime.d.ts",
22
+ "default": "./dist/runtime.js"
17
23
  },
18
24
  "./theme": {
19
- "default": "./theme.ts"
25
+ "types": "./dist/theme.d.ts",
26
+ "default": "./dist/theme.js"
20
27
  },
21
28
  "./config": {
22
- "default": "./config.ts"
29
+ "types": "./dist/config.d.ts",
30
+ "default": "./dist/config.js"
23
31
  },
24
32
  "./shiki-transformers": {
25
- "default": "./shiki-transformers.ts"
33
+ "types": "./dist/shiki-transformers.d.ts",
34
+ "default": "./dist/shiki-transformers.js"
26
35
  },
27
36
  "./package.json": "./package.json"
28
37
  },
@@ -35,24 +44,20 @@
35
44
  "files": [
36
45
  "bin",
37
46
  "dist",
38
- "runtime.ts",
39
- "theme.ts",
40
- "config.ts",
41
- "shiki-transformers.ts",
42
47
  "meta-json-schema.json",
43
48
  "nav-json-schema.json"
44
49
  ],
45
50
  "dependencies": {
46
- "@rsbuild/core": "~1.4.3",
51
+ "@rsbuild/core": "~1.4.6",
47
52
  "cac": "^6.7.14",
48
53
  "chokidar": "^3.6.0",
49
54
  "picocolors": "^1.1.1",
50
- "@rspress/core": "2.0.0-beta.20",
51
- "@rspress/shared": "2.0.0-beta.20"
55
+ "@rspress/shared": "2.0.0-beta.21",
56
+ "@rspress/core": "2.0.0-beta.21"
52
57
  },
53
58
  "devDependencies": {
54
59
  "@microsoft/api-extractor": "^7.52.8",
55
- "@rslib/core": "0.10.4",
60
+ "@rslib/core": "0.10.5",
56
61
  "@types/jest": "~29.5.14",
57
62
  "@types/node": "^22.8.1",
58
63
  "@types/react": "^19.1.8",
package/config.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { UserConfig } from '@rspress/core';
2
-
3
- export function defineConfig(config: UserConfig): UserConfig {
4
- return config;
5
- }
6
-
7
- export type { UserConfig };
package/runtime.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@rspress/core/runtime';
@@ -1,2 +0,0 @@
1
- // FIXME: rspack-resolver bug, export * from '@rspress/core/shiki-transformers';
2
- export * from '@rspress/core/dist/shiki-transformers.js';
package/theme.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@rspress/core/theme';