rspress 1.0.0-beta.4 → 1.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -29
  2. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -55,11 +55,7 @@ async function loadConfigFile(customConfigFile) {
55
55
  }
56
56
 
57
57
  // src/index.ts
58
- var CONFIG_FILES = [
59
- "rspress.config.ts",
60
- "rspress.config.js",
61
- "_meta.json"
62
- ];
58
+ var CONFIG_FILES = ["rspress.config.ts", "rspress.config.js", "_meta.json"];
63
59
  var require2 = createRequire2(import.meta.url);
64
60
  var packageJson = require2("../package.json");
65
61
  var cli = cac("rspress").version(packageJson.version).help();
@@ -90,22 +86,22 @@ cli.command("[root]", "start dev server").alias("dev").action(async (root, optio
90
86
  docDirectory,
91
87
  config
92
88
  });
93
- cliWatcher = chokidar.watch([
94
- `${cwd}/**/{${CONFIG_FILES.join(",")}}`,
95
- docDirectory
96
- ], {
97
- ignoreInitial: true,
98
- ignored: [
99
- "**/node_modules/**",
100
- "**/.git/**",
101
- "**/.DS_Store/**"
102
- ]
103
- });
89
+ cliWatcher = chokidar.watch(
90
+ [`${cwd}/**/{${CONFIG_FILES.join(",")}}`, docDirectory],
91
+ {
92
+ ignoreInitial: true,
93
+ ignored: ["**/node_modules/**", "**/.git/**", "**/.DS_Store/**"]
94
+ }
95
+ );
104
96
  cliWatcher.on("all", async (eventName, filepath) => {
105
97
  if (eventName === "add" || eventName === "unlink" || eventName === "change" && CONFIG_FILES.includes(path2.basename(filepath))) {
106
- console.log(`
107
- ✨ ${eventName} ${chalk.green(path2.relative(cwd, filepath))}, dev server will restart...
108
- `);
98
+ console.log(
99
+ `
100
+ ✨ ${eventName} ${chalk.green(
101
+ path2.relative(cwd, filepath)
102
+ )}, dev server will restart...
103
+ `
104
+ );
109
105
  await devServer.close();
110
106
  await cliWatcher.close();
111
107
  await startDevServer();
@@ -133,14 +129,16 @@ cli.command("build [root]").option("-c --config <config>", "specify config file"
133
129
  config
134
130
  });
135
131
  });
136
- cli.command("preview").alias("serve").option("-c --config <config>", "specify config file").option("--port [port]", "port number").option("--host [host]", "hostname").action(async (options) => {
137
- setNodeEnv("production");
138
- const { port, host } = options || {};
139
- const config = await loadConfigFile(options?.config);
140
- await serve({
141
- config,
142
- host,
143
- port
144
- });
145
- });
132
+ cli.command("preview").alias("serve").option("-c --config <config>", "specify config file").option("--port [port]", "port number").option("--host [host]", "hostname").action(
133
+ async (options) => {
134
+ setNodeEnv("production");
135
+ const { port, host } = options || {};
136
+ const config = await loadConfigFile(options?.config);
137
+ await serve({
138
+ config,
139
+ host,
140
+ port
141
+ });
142
+ }
143
+ );
146
144
  cli.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.1",
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
- "@modern-js/node-bundle-require": "2.35.1",
31
+ "@modern-js/node-bundle-require": "2.36.0",
32
32
  "cac": "^6.7.14",
33
33
  "chokidar": "^3.5.3",
34
34
  "chalk": "5.3.0",
35
- "@rspress/core": "1.0.0-beta.4",
36
- "@rspress/shared": "1.0.0-beta.4"
35
+ "@rspress/core": "1.0.1",
36
+ "@rspress/shared": "1.0.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "~29.2.4",
@@ -49,6 +49,7 @@
49
49
  "provenance": true,
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
+ "license": "MIT",
52
53
  "files": [
53
54
  "bin",
54
55
  "dist",