rspress 1.15.0 → 1.16.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.js +14 -17
- package/package.json +4 -4
package/dist/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
// src/index.ts
|
2
|
-
import { createRequire
|
2
|
+
import { createRequire } from "module";
|
3
3
|
import path3 from "path";
|
4
4
|
import { cac } from "cac";
|
5
5
|
import { build, dev, serve } from "@rspress/core";
|
6
|
-
import { logger as
|
6
|
+
import { logger as logger3 } from "@rspress/shared/logger";
|
7
7
|
import chokidar from "chokidar";
|
8
8
|
import chalk from "chalk";
|
9
9
|
|
10
10
|
// src/config/loadConfigFile.ts
|
11
11
|
import fs from "fs";
|
12
12
|
import path from "path";
|
13
|
-
import {
|
13
|
+
import { logger } from "@rspress/shared/logger";
|
14
14
|
|
15
15
|
// src/constants.ts
|
16
16
|
var DEFAULT_CONFIG_NAME = "rspress.config";
|
@@ -40,18 +40,15 @@ async function loadConfigFile(customConfigFile) {
|
|
40
40
|
configFilePath = findConfig(path.join(baseDir, DEFAULT_CONFIG_NAME));
|
41
41
|
}
|
42
42
|
if (!configFilePath) {
|
43
|
-
|
43
|
+
logger.info(`No config file found in ${baseDir}`);
|
44
44
|
return {};
|
45
45
|
}
|
46
|
-
const
|
47
|
-
const
|
48
|
-
|
49
|
-
|
46
|
+
const { loadConfig } = await import("@rsbuild/core");
|
47
|
+
const { content } = await loadConfig({
|
48
|
+
cwd: path.dirname(configFilePath),
|
49
|
+
path: configFilePath
|
50
50
|
});
|
51
|
-
|
52
|
-
result = result.default || {};
|
53
|
-
}
|
54
|
-
return result;
|
51
|
+
return content;
|
55
52
|
}
|
56
53
|
|
57
54
|
// src/update.ts
|
@@ -59,7 +56,7 @@ import path2 from "path";
|
|
59
56
|
import fs2 from "fs/promises";
|
60
57
|
import { spawn } from "child_process";
|
61
58
|
import { pathExists } from "@rspress/shared/fs-extra";
|
62
|
-
import { logger } from "@rspress/shared/logger";
|
59
|
+
import { logger as logger2 } from "@rspress/shared/logger";
|
63
60
|
var lockfileMap = {
|
64
61
|
"package-lock.json": "npm",
|
65
62
|
"yarn.lock": "yarn",
|
@@ -90,7 +87,7 @@ async function update() {
|
|
90
87
|
const cwd = process.cwd();
|
91
88
|
const packageManager = await getPackageManager(cwd);
|
92
89
|
const rspressDependencies = await getRspressDependencies(cwd);
|
93
|
-
|
90
|
+
logger2.greet(
|
94
91
|
`Using ${packageManager} to update ${rspressDependencies.join(" ")}`
|
95
92
|
);
|
96
93
|
if (packageManager === "npm" || packageManager === "bun") {
|
@@ -113,12 +110,12 @@ var CONFIG_FILES = [
|
|
113
110
|
"_meta.json",
|
114
111
|
"i18n.json"
|
115
112
|
];
|
116
|
-
var require2 =
|
113
|
+
var require2 = createRequire(import.meta.url);
|
117
114
|
var packageJson = require2("../package.json");
|
118
115
|
var cli = cac("rspress").version(packageJson.version).help();
|
119
116
|
var landingMessage = `🔥 Rspress v${packageJson.version}
|
120
117
|
`;
|
121
|
-
|
118
|
+
logger3.greet(landingMessage);
|
122
119
|
var setNodeEnv = (env) => {
|
123
120
|
process.env.NODE_ENV = env;
|
124
121
|
};
|
@@ -207,5 +204,5 @@ cli.command("preview").alias("serve").option("--port [port]", "port number").opt
|
|
207
204
|
});
|
208
205
|
}
|
209
206
|
);
|
210
|
-
cli.command("update", "update
|
207
|
+
cli.command("update", "update relevant packages about rspress").action(update);
|
211
208
|
cli.parse();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "rspress",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.16.0",
|
4
4
|
"type": "module",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"main": "./dist/index.js",
|
@@ -28,12 +28,12 @@
|
|
28
28
|
}
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@
|
31
|
+
"@rsbuild/core": "0.5.1",
|
32
32
|
"cac": "^6.7.14",
|
33
33
|
"chokidar": "^3.5.3",
|
34
34
|
"chalk": "5.3.0",
|
35
|
-
"@rspress/core": "1.
|
36
|
-
"@rspress/shared": "1.
|
35
|
+
"@rspress/core": "1.16.0",
|
36
|
+
"@rspress/shared": "1.16.0"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
39
|
"@types/jest": "~29.2.4",
|