rspress 1.0.0-beta.5 → 1.0.2

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 (3) hide show
  1. package/README.md +42 -1
  2. package/dist/index.js +27 -29
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1 +1,42 @@
1
- # rspress
1
+ # Rspress
2
+
3
+ <picture>
4
+ <img alt="Rspress Banner" src="https://github.com/web-infra-dev/rspress/assets/39261479/999e7946-45ff-45d5-b9cd-594e634e0e5a">
5
+ </picture>
6
+
7
+ <h2 align="center">A fast Rspack-based static site generator.</h2>
8
+
9
+ ## Features
10
+
11
+ - **🚀 Fast Startup**: Based on Rust-based build tool and markdown/mdx compiler, the build speed is extremely fast, bringing you the ultimate development experience.
12
+ - **📚 MDX Support**: MDX is a powerful way to write content, allowing you to use React components in Markdown.
13
+ - **📦 Built-in Full Text Search**: Automatically generates a full-text search index for you during building process, providing out-of-the-box full-text search capabilities.
14
+ - **🌈 Static Site Generation**: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
15
+ - **🔌 Providing Plugin System**: Providing a plugin system, you can customize the build process and theme according to your needs.
16
+ - **📝 Component Document**: Support multi ways to preview your component demo.
17
+
18
+ ## Getting Started
19
+
20
+ Go to the [Quick Start](https://rspress.dev/guide/start/getting-started.html) to get started.
21
+
22
+ ## Contribution
23
+
24
+ Please read the [contributing guide](./CONTRIBUTING.md) and let's build Rspress together.
25
+
26
+ If you have any quesions, you can open an issue or go to [Discord](https://discord.com/channels/977448667919286283/1161653869080756245) to communicate with us.
27
+
28
+ ### Code of Conduct
29
+
30
+ This repo has adopted the ByteDance Open Source Code of Conduct. Please check [Code of Conduct](./CODE_OF_CONDUCT.md) for more details.
31
+
32
+ ### Links
33
+
34
+ | Name | Description |
35
+ | ---------------------------------------------------------- | --------------------------------------- |
36
+ | [@rspress/mdx-rs](https://github.com/web-infra-dev/mdx-rs) | Rust MDX compiler for Rspress. |
37
+ | [Rspack](https://github.com/web-infra-dev/rspack) | A fast Rust-based web bundler. |
38
+ | [Rsbuild](https://github.com/web-infra-dev/rsbuild) | An Rspack-based build tool for the web. |
39
+
40
+ ### License
41
+
42
+ Rspress is licensed under the [MIT License](./LICENSE).
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.5",
3
+ "version": "1.0.2",
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.5",
36
- "@rspress/shared": "1.0.0-beta.5"
35
+ "@rspress/core": "1.0.2",
36
+ "@rspress/shared": "1.0.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "~29.2.4",