-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-preserve-query-on-redirect
- Loading branch information
Showing
88 changed files
with
944 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# .github/release.yml | ||
|
||
changelog: | ||
exclude: | ||
authors: | ||
# Ignore the release PR created by github-actions | ||
- github-actions | ||
categories: | ||
- title: Breaking Changes 🍭 | ||
labels: | ||
- "change: breaking" | ||
- title: New Features 🎉 | ||
labels: | ||
- "change: feat" | ||
- title: Performance 🚀 | ||
labels: | ||
- "change: perf" | ||
- title: Bug Fixes 🐞 | ||
labels: | ||
- "change: fix" | ||
- title: Document 📖 | ||
labels: | ||
- "change: docs" | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Hello World | ||
|
||
## API | ||
|
||
This is API Table | ||
|
||
<API moduleName="button" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "@rspress-fixture/rspress-api-docgen", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "rspress dev", | ||
"build": "rspress build", | ||
"preview": "rspress preview" | ||
}, | ||
"dependencies": { | ||
"@rspress/plugin-api-docgen": "workspace:*", | ||
"rspress": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import path from 'path'; | ||
import { defineConfig } from 'rspress/config'; | ||
import { pluginApiDocgen } from '@rspress/plugin-api-docgen'; | ||
|
||
export default defineConfig({ | ||
root: path.join(__dirname, 'doc'), | ||
plugins: [ | ||
pluginApiDocgen({ | ||
entries: { | ||
button: './src/Button.ts', | ||
}, | ||
apiParseTool: 'react-docgen-typescript', | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export type ButtonProps = { | ||
/** | ||
* Whether to disable the button | ||
* - This is extra line a | ||
* - This is extra line b | ||
*/ | ||
disabled?: boolean; | ||
/** | ||
* Type of Button | ||
* @default 'default' | ||
*/ | ||
size?: 'mini' | 'small' | 'default' | 'large'; | ||
}; | ||
|
||
export const Button = (props?: ButtonProps) => {}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@rspress-fixture/rspress-custom-id", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "rspress dev", | ||
"build": "rspress build", | ||
"preview": "rspress preview" | ||
}, | ||
"dependencies": { | ||
"rspress": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as path from 'path'; | ||
import { defineConfig } from 'rspress/config'; | ||
|
||
export default defineConfig({ | ||
root: path.join(__dirname, 'doc'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"type": "dir", | ||
"name": "basic", | ||
"label": "basic" | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section-header", | ||
"label": "growth" | ||
} | ||
] |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ixtures/i18n/doc/en/guide/quick-start.mdx → ...s/i18n/doc/en/guide/basic/quick-start.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Quick Start | ||
|
||
[click by absolute path](/guide/install) to go to install | ||
[click by absolute path](/guide/basic/install) to go to install | ||
|
||
[click for relative path](./install) to go to install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"type": "dir", | ||
"name": "basic", | ||
"label": "basic" | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section-header", | ||
"label": "growth" | ||
} | ||
] |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ixtures/i18n/doc/zh/guide/quick-start.mdx → ...s/i18n/doc/zh/guide/basic/quick-start.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# 快速开始 | ||
|
||
[点击通过绝对路径](/guide/install) 跳往安装 | ||
[点击通过绝对路径](/guide/basic/install) 跳往安装 | ||
|
||
[点击通过相对路径](./install) 跳往安装 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"basic": { | ||
"zh": "基本", | ||
"en": "Basic" | ||
}, | ||
"growth": { | ||
"zh": "成长", | ||
"en": "Growth" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Content from './content.mdx'; | ||
|
||
<Content /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@rspress-fixture/rspress-replace-rules", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "rspress dev", | ||
"build": "rspress build", | ||
"preview": "rspress preview" | ||
}, | ||
"dependencies": { | ||
"rspress": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as path from 'path'; | ||
import { defineConfig } from 'rspress/config'; | ||
|
||
export default defineConfig({ | ||
root: path.join(__dirname, 'doc'), | ||
replaceRules: [ | ||
{ | ||
search: /content/g, | ||
replace: 'h1', | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import path from 'path'; | ||
import { getPort, killProcess, runDevCommand } from '../utils/runCommands'; | ||
|
||
const fixtureDir = path.resolve(__dirname, '../fixtures'); | ||
|
||
test.describe('api-docgen test', async () => { | ||
let appPort; | ||
let app; | ||
|
||
test.beforeAll(async () => { | ||
const appDir = path.join(fixtureDir, 'api-docgen'); | ||
appPort = await getPort(); | ||
app = await runDevCommand(appDir, appPort); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
if (app) { | ||
await killProcess(app); | ||
} | ||
}); | ||
|
||
test('Index page', async ({ page }) => { | ||
await page.goto(`http://localhost:${appPort}`); | ||
const table = await page.$('table'); | ||
const tableContent = await page.evaluate(table => table?.innerHTML, table); | ||
|
||
// Property | ||
expect(tableContent).toContain('Property'); | ||
expect(tableContent).toContain('disabled'); | ||
expect(tableContent).toContain('size'); | ||
|
||
// Description | ||
expect(tableContent).toContain('Description'); | ||
expect(tableContent).toContain('Whether to disable the button'); | ||
expect(tableContent).toContain('- This is extra line a'); | ||
expect(tableContent).toContain('- This is extra line b'); | ||
expect(tableContent).toContain('Type of Button'); | ||
|
||
// Type | ||
expect(tableContent).toContain('Type'); | ||
expect(tableContent).toContain('boolean'); | ||
expect(tableContent).toContain('"mini" | "small" | "default" | "large"'); | ||
|
||
// Default Value | ||
expect(tableContent).toContain('Default Value'); | ||
expect(tableContent).toContain('-'); | ||
expect(tableContent).toContain("'default'"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import path from 'path'; | ||
import { getPort, killProcess, runDevCommand } from '../utils/runCommands'; | ||
|
||
const fixtureDir = path.resolve(__dirname, '../fixtures'); | ||
|
||
test.describe('custom-id test', async () => { | ||
let appPort; | ||
let app; | ||
test.beforeAll(async () => { | ||
const appDir = path.join(fixtureDir, 'custom-id'); | ||
appPort = await getPort(); | ||
app = await runDevCommand(appDir, appPort); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
if (app) { | ||
await killProcess(app); | ||
} | ||
}); | ||
|
||
test('Guide page', async ({ page }) => { | ||
await page.goto(`http://localhost:${appPort}/guide`, { | ||
waitUntil: 'networkidle', | ||
}); | ||
const h1 = await page.$('h1'); | ||
const className = await page.evaluate(h1 => h1?.className, h1); | ||
expect(className).toContain('title_3b154'); // hash in css module should stable | ||
const text = await page.evaluate(h1 => h1?.textContent, h1); | ||
expect(text).toContain('Guide'); | ||
}); | ||
|
||
}); |
Oops, something went wrong.