Skip to content

Commit

Permalink
Merge branch 'main' into renovate/nrwl-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 authored Apr 23, 2024
2 parents aae5062 + fb8eb1c commit 6ec9efd
Show file tree
Hide file tree
Showing 45 changed files with 800 additions and 497 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@rspress/theme-default": patch
---

fix: remove invalid `className`
hero use align-items
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ jobs:

- name: Lint
run: pnpm run lint

- name: Check Dependency Version
run: pnpm run check-dependency-version
4 changes: 2 additions & 2 deletions e2e/fixtures/custom-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@rspress/plugin-playground": "workspace:*",
"@rspress/plugin-preview": "workspace:*",
"@rspress/shared": "workspace:*",
"react": "^18",
"react-dom": "^18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-transition-group": "4.4.5",
"rspress": "workspace:*",
"solid-js": "^1.8.12"
Expand Down
4 changes: 0 additions & 4 deletions e2e/fixtures/modern-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,5 @@
"react-dom": "^18.2.0",
"typescript": "^5"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"sideEffects": []
}
4 changes: 2 additions & 2 deletions e2e/fixtures/plugin-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@rspress/plugin-playground": "workspace:*",
"@rspress/plugin-preview": "workspace:*",
"@rspress/shared": "workspace:*",
"react": "^18",
"react-dom": "^18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-transition-group": "4.4.5",
"rspress": "workspace:*",
"solid-js": "^1.8.12"
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"changeset": "changeset",
"prepare": "npm run build && husky install",
"check-spell": "npx cspell",
"check-dependency-version": "check-dependency-version-consistency . --dep-type devDependencies",
"dev": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t dev --exclude @rspress-fixture/*",
"build": "cross-env NX_DAEMON=false NX_REJECT_UNKNOWN_LOCAL_CACHE=0 nx run-many -t build --exclude @rspress-fixture/*",
"test": "pnpm test:unit && pnpm test:e2e",
Expand All @@ -25,6 +26,9 @@
"lint-staged": {
"*.{ts,tsx,js,jsx,mjs,cjs}": [
"biome lint . --diagnostic-level=warn"
],
"package.json": [
"pnpm run check-dependency-version"
]
},
"workspaces": {
Expand All @@ -36,6 +40,7 @@
]
},
"devDependencies": {
"check-dependency-version-consistency": "^4.1.0",
"@biomejs/biome": "1.5.3",
"@changesets/cli": "^2.27.1",
"@manypkg/get-packages": "^2.2.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rspress",
"version": "1.18.2",
"version": "1.18.3",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
Expand Down Expand Up @@ -46,11 +46,11 @@
},
"devDependencies": {
"@types/jest": "~29.2.4",
"@types/node": "~16.11.7",
"@types/react": "~18.0.26",
"rimraf": "~3.0.2",
"@types/node": "^18.11.17",
"@types/react": "^18",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "~5.0.4"
"typescript": "^5"
},
"sideEffects": [],
"publishConfig": {
Expand Down
12 changes: 6 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rspress/core",
"version": "1.18.2",
"version": "1.18.3",
"description": "The Rspress Documentation Framework",
"bugs": "https://github.com/web-infra-dev/rspress/issues",
"repository": {
Expand Down Expand Up @@ -93,19 +93,19 @@
"@modern-js/plugin-tailwindcss": "2.49.0",
"@modern-js/tsconfig": "2.49.0",
"@types/body-scroll-lock": "^3.1.0",
"@types/hast": "^2.3.4",
"@types/hast": "3.0.3",
"@types/html-to-text": "^8.1.1",
"@types/jest": "^26.0.9",
"@types/lodash-es": "^4.17.6",
"@types/jest": "~29.2.4",
"@types/lodash-es": "^4.17.8",
"@types/mdast": "^3.0.10",
"@types/node": "^14",
"@types/node": "^18.11.17",
"@types/nprogress": "^0.2.0",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/yaml-front-matter": "^4.1.0",
"rimraf": "^3.0.2",
"typescript": "^5",
"vitest": "0.33.0",
"vitest": "0.34.1",
"webpack": "^5.88.1"
},
"sideEffects": [
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/runtime/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export async function initPageData(routePath: string): Promise<PageData> {
const extractPageInfo = siteData.pages.find(page => {
const normalize = (p: string) =>
// compat the path that has no / suffix and ignore case
p
.replace(/\/$/, '')
.toLowerCase();
p.replace(/\/$/, '').toLowerCase();
return isEqualPath(normalize(page.routePath), normalize(routePath));
});

Expand Down Expand Up @@ -81,7 +79,7 @@ export async function initPageData(routePath: string): Promise<PageData> {
frontmatter: {},
title: '404',
toc: [],
version: '',
version: siteData.multiVersion.default || '',
_filepath: '',
_relativePath: '',
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-rspress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-rspress",
"version": "1.18.2",
"version": "1.18.3",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.js",
Expand All @@ -22,13 +22,13 @@
},
"devDependencies": {
"@types/jest": "~29.2.4",
"@types/node": "~16.11.7",
"@types/node": "^18.11.17",
"@types/prompts": "^2.4.4",
"@types/react": "~18.0.26",
"@types/react": "^18",
"@types/fs-extra": "11.0.4",
"rimraf": "~3.0.2",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "~5.0.4",
"typescript": "^5",
"cac": "6.7.14",
"chalk": "5.3.0",
"fs-extra": "11.2.0",
Expand Down
21 changes: 17 additions & 4 deletions packages/document/docs/en/api/config/config-frontmatter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import PageType from '@en/fragments/page-type';
The hero config for the home page. It has the following types:

```ts
export interface Hero {
interface Hero {
name: string;
text: string;
tagline: string;
Expand Down Expand Up @@ -81,7 +81,7 @@ pageType: home

hero:
name: Rspress
text: A documentation solution
text: A Documentation Solution
tagline: A modern documentation development technology stack
titleSuffix: '- Rspack-based Static Site Generator'
actions:
Expand All @@ -94,6 +94,19 @@ hero:
---
```

When setting `hero.text`, you can use the `|` symbol in YAML to manually control line breaks:

```yaml
---
pageType: home

hero:
name: Rspress
text: |
A Documentation
Solution
```
Or you can use `HTML` to specify the hero config for the page:

```yaml
Expand All @@ -102,7 +115,7 @@ pageType: home
hero:
name: <span class="hero-name">Rspress</span>
text: <span class="hero-text">A documentation solution</span>
text: <span class="hero-text">A Documentation Solution</span>
tagline: <span class="hero-tagline">A modern documentation development technology stack</span>
actions:
- theme: brand
Expand All @@ -122,7 +135,7 @@ hero:
features config of the `home` page. It has the following types:

```ts
export interface Feature {
interface Feature {
title: string;
details: string;
icon: string;
Expand Down
10 changes: 5 additions & 5 deletions packages/document/docs/en/fragments/internal-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface BadgeProps {

## Helmet

It is generally used to set custom head content in documents (using `react-helmet-async` at the underlying level). The usage is as follows:
It is generally used to set custom head content in documents (based on [react-helmet-async](https://www.npmjs.com/package/react-helmet-async)). The usage is as follows:

```tsx title="index.tsx"
// Below is a custom component, you can import it into your document
Expand All @@ -40,7 +40,7 @@ import { Helmet } from 'rspress/runtime';
function App() {
return (
<Helmet>
<meta property="og:description" value="Out-of-box Rspack build tools">
<meta property="og:description" value="Out-of-box Rspack build tools" />
</Helmet>
);
}
Expand All @@ -53,7 +53,7 @@ Feature component in Hero page, look [the effect in this website](/).
```tsx
import { HomeFeature } from 'rspress/theme';

export interface Feature {
interface Feature {
title: string;
details: string;
icon: string;
Expand All @@ -72,7 +72,7 @@ Hero component in Hero page.
```tsx
import { HomeHero } from 'rspress/theme';

export interface Hero {
interface Hero {
name: string;
text: string;
tagline: string;
Expand Down Expand Up @@ -140,7 +140,7 @@ interface Group {
items: GroupItem[];
}

export interface OverviewProps {
interface OverviewProps {
// content before data rendering
content?: React.ReactNode;
// data
Expand Down
4 changes: 4 additions & 0 deletions packages/document/docs/en/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const Layout = () => (
beforeDoc={<div>beforeDoc</div>}
/* Doc page end */
afterDoc={<div>afterDoc</div>}
/* Doc content front */
beforeDocContent={<div>beforeDocContent</div>}
/* Doc content end */
afterDocContent={<div>afterDocContent</div>}
/* Before the nav bar */
beforeNav={<div>beforeNav</div>}
/* Before the title of the nav bar in the upper left corner */
Expand Down
17 changes: 15 additions & 2 deletions packages/document/docs/zh/api/config/config-frontmatter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import PageType from '@zh/fragments/page-type';
`home` 页面的 hero 配置。它有以下类型:

```ts
export interface Hero {
interface Hero {
name: string;
text: string;
tagline: string;
Expand Down Expand Up @@ -94,6 +94,19 @@ hero:
---
```

在设置 `hero.text` 时,你可以使用 YAML 的 `|` 符号来手动控制换行:

```yaml
---
pageType: home

hero:
name: Rspress
text: |
文档工程
解决方案
```
或者你也可以用 `HTML` 来指定页面的 hero config:

```yaml
Expand Down Expand Up @@ -122,7 +135,7 @@ hero:
`home` 页面的功能配置。它有以下类型:

```ts
export interface Feature {
interface Feature {
title: string;
details: string;
icon: string;
Expand Down
10 changes: 5 additions & 5 deletions packages/document/docs/zh/fragments/internal-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface BadgeProps {

## Helmet

一般用于在文档中设置自定义 head 内容(底层使用 `react-helmet-async`)。使用方法如下:
一般用于在文档中设置自定义 head 内容(基于 [react-helmet-async](https://www.npmjs.com/package/react-helmet-async)。使用方法如下:

```tsx title="index.tsx"
// 以下为一个自定义组件,你可以将其引入到文档中
Expand All @@ -40,7 +40,7 @@ import { Helmet } from 'rspress/runtime';
function App() {
return (
<Helmet>
<meta property="og:description" value="Out-of-box Rspack build tools">
<meta property="og:description" value="Out-of-box Rspack build tools" />
</Helmet>
);
}
Expand All @@ -53,7 +53,7 @@ Home 页面 Feature 组件,查看[本站的效果](/zh/)
```tsx
import { HomeFeature } from 'rspress/theme';

export interface Feature {
interface Feature {
title: string;
details: string;
icon: string;
Expand All @@ -73,7 +73,7 @@ Home 页面 Hero 组件
```tsx
import { HomeHero } from 'rspress/theme';

export interface Hero {
interface Hero {
name: string;
text: string;
tagline: string;
Expand Down Expand Up @@ -141,7 +141,7 @@ interface Group {
items: GroupItem[];
}

export interface OverviewProps {
interface OverviewProps {
// 预览部分上方的内容
content?: React.ReactNode;
// 预览数据
Expand Down
4 changes: 4 additions & 0 deletions packages/document/docs/zh/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const Layout = () => (
beforeDoc={<div>beforeDoc</div>}
/* 正文页最后面 */
afterDoc={<div>afterDoc</div>}
/* 文档内容前面 */
beforeDocContent={<div>beforeDocContent</div>}
/* 文档内容后面 */
afterDocContent={<div>afterDocContent</div>}
/* 导航栏之前 */
beforeNav={<div>beforeNav</div>}
/* 左上角导航栏标题之前 */
Expand Down
4 changes: 2 additions & 2 deletions packages/document/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rspress/docs",
"version": "1.18.2",
"version": "1.18.3",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"devDependencies": {
"@documate/documate": "^0.1.0",
"@documate/react": "0.2.1",
"@types/react": "18.2.0",
"@types/react": "^18",
"framer-motion": "10.18.0",
"rsbuild-plugin-google-analytics": "^1.0.0",
"rsbuild-plugin-open-graph": "^1.0.0",
Expand Down
Loading

0 comments on commit 6ec9efd

Please sign in to comment.