rspress-plugin-gh-pages 0.1.3 → 0.1.5-beta.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/CHANGELOG.md ADDED
@@ -0,0 +1,26 @@
1
+ # rspress-plugin-gh-pages
2
+
3
+ ## 0.1.5-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [932dbb7]
8
+ - rspress-plugin-devkit@0.1.2-beta.0
9
+
10
+ ## 0.1.4
11
+
12
+ ### Patch Changes
13
+
14
+ - 546dcf0: release beta
15
+ - 5e28903: fixup publish config
16
+ - Updated dependencies [546dcf0]
17
+ - Updated dependencies [5e28903]
18
+ - rspress-plugin-devkit@0.1.1
19
+
20
+ ## 0.1.4-beta.0
21
+
22
+ ### Patch Changes
23
+
24
+ - 546dcf0: release beta
25
+ - Updated dependencies [546dcf0]
26
+ - rspress-plugin-devkit@0.1.1-beta.0
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # rspress-plugin-gh-pages ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-gh-pages)
2
2
 
3
+ [简体中文](./README.zh-CN.md)
4
+
3
5
  Rspress plugin to add support for automatic deployment to GitHub Pages.
4
6
 
5
7
  - **No need to push the code and wait for the pages to be updated**: Every time you run `rspress build`, the plugin will automatically push the generated files to the specified `gh-pages` branch of the repository
@@ -30,12 +32,11 @@ export default defineConfig({
30
32
 
31
33
  ## Configure
32
34
 
33
- ## repo
35
+ ## directory
34
36
 
35
- - Type: `string`
36
- - `Required`
37
+ Target directory to push to the `gh-pages` branch, `config.outDir` will be used if this configuration is not specified.
37
38
 
38
- The repository to deploy to, you can also specify another repository to deploy to.
39
+ - Type: `string`
39
40
 
40
41
  ## siteBase
41
42
 
@@ -43,4 +44,20 @@ The repository to deploy to, you can also specify another repository to deploy t
43
44
 
44
45
  Deploying to repositories other than the `<user>.github.io` repository requires specifying the `siteBase` option, as an example, deploying to repository `<user>/awesome-plugins` will require setting `siteBase` to `/awesome-plugins`, as the page will be hosted at `https://<user>.github.io/awesome-plugins`.
45
46
 
46
- By default, `rspress-plugin-gh-pages` will try to parse the `repo` option to get a `siteBase` value(if repo is a `github.io` repository, the `siteBase` will be `/`, otherwise, the `siteBase` will be `/<repo-name>`), you can also specify the `siteBase` option to override the default value.
47
+ By default, this plugin will try to parse the `repo` option to get a `siteBase` value(if repo is a `github.io` repository, the `siteBase` will be `/`, otherwise, the `siteBase` will be `/<repo-name>`), you can also specify the `siteBase` option to override the default value.
48
+
49
+ ## silent
50
+
51
+ Disable terminal log output from this plugin.
52
+
53
+ - Type: `boolean`
54
+ - Default: false
55
+
56
+ ## repo
57
+
58
+ - Type: `string`
59
+ - `Required`
60
+
61
+ The repository to deploy to, you can also specify another repository to deploy to.
62
+
63
+ More options can be found in documentation of [gh-pages](https://github.com/tschaub/gh-pages).
@@ -0,0 +1,63 @@
1
+ # rspress-plugin-gh-pages ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-gh-pages)
2
+
3
+ 提供 GitHub Pages 自动部署支持的 Rspress 插件。
4
+
5
+ - **无需推送代码后寂寞等待页面更新**: 每次运行 `rspress build` 时,插件会自动将生成的静态资源推送到指定仓库的指定分支。
6
+ - **无需复杂的持续集成配置**: 插件仅会将静态文件推送到指定的分支,而无需等待云端构建流程,因此页面更新生效速度更快。
7
+
8
+ ## 使用
9
+
10
+ ```bash
11
+ npm i rspress-plugin-gh-pages
12
+ pnpm add rspress-plugin-gh-pages
13
+ ```
14
+
15
+ ```ts
16
+ import * as path from 'path';
17
+ import { defineConfig } from 'rspress/config';
18
+ import ghPages from 'rspress-plugin-gh-pages';
19
+
20
+ export default defineConfig({
21
+ root: path.join(__dirname, 'docs'),
22
+ plugins: [
23
+ ghpages({
24
+ repo: 'https://github.com/linbudu599/rspress-plugins.git',
25
+ branch: 'website',
26
+ }),
27
+ ],
28
+ });
29
+ ```
30
+
31
+ ## 配置
32
+
33
+ ## directory
34
+
35
+ 将要推送到 `gh-pages` 分支的目标目录,如果未指定此配置,则将使用 `config.outDir`。
36
+
37
+ - Type: `string`
38
+
39
+ ## siteBase
40
+
41
+ 配置站点的基础路径,可以理解为 `publicPath`.
42
+
43
+ - Type: `string`
44
+
45
+ 当部署到 `<user>/awesome-plugins` 仓库时,需要将 `siteBase` 配置设置为 `/awesome-plugins`,因为页面将托管在 `https://<user>.github.io/awesome-plugins`。
46
+
47
+ 默认情况下,该插件会尝试解析 `repo` 选项以获取 `siteBase` 值(如果 repo 是一个 `github.io` 类型的仓库,则 `siteBase` 将是 `/`,否则,`siteBase` 将是 `/<repo-name>`),你也可以指定 `siteBase` 选项来覆盖默认值。
48
+
49
+ ## silent
50
+
51
+ 禁用此插件的终端日志输出。
52
+
53
+ - Type: `boolean`
54
+ - Default: false
55
+
56
+ ## repo
57
+
58
+ - Type: `string`
59
+ - `Required`
60
+
61
+ 将要部署到的仓库,你也可以指定另一个仓库来部署。
62
+
63
+ 更多选项可以在 [gh-pages](https://github.com/tschaub/gh-pages) 找到。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress-plugin-gh-pages",
3
- "version": "0.1.3",
3
+ "version": "0.1.5-beta.0",
4
4
  "description": "Rspress plugin that add support for automatic deployment to GitHub Pages",
5
5
  "keywords": [
6
6
  "rspress",
@@ -20,11 +20,14 @@
20
20
  "author": "Linbudu <linbudu599@gmail.com> (https://github.com/linbudu599)",
21
21
  "main": "dist/index.js",
22
22
  "types": "dist/index.d.ts",
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
23
26
  "dependencies": {
24
27
  "@rspress/shared": "^1.17.1",
25
28
  "chalk": "^5.3.0",
26
29
  "gh-pages": "^6.1.1",
27
- "rspress-plugin-devkit": "^0.1.0"
30
+ "rspress-plugin-devkit": "^0.1.2-beta.0"
28
31
  },
29
32
  "devDependencies": {
30
33
  "@types/gh-pages": "^6.1.0",
@@ -38,7 +41,6 @@
38
41
  "build": "tsc --declarationMap false",
39
42
  "dev": "tsc -w",
40
43
  "docs:build": "rspress build",
41
- "docs:dev": "rspress dev",
42
- "prepublish": "npm run build"
44
+ "docs:dev": "rspress dev"
43
45
  }
44
46
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "rootDir": "src",
4
- "outDir": "dist"
4
+ "outDir": "dist",
5
+ "module": "NodeNext",
6
+ "moduleResolution": "nodenext"
5
7
  },
6
8
  "include": ["src"],
7
9
  "extends": "../../tsconfig.base.json"