Skip to content

Commit b238144

Browse files
committed
chore: update
1 parent 7f7295b commit b238144

File tree

10 files changed

+511
-308
lines changed

10 files changed

+511
-308
lines changed

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,11 @@
5353
"[less]": {
5454
"editor.defaultFormatter": "esbenp.prettier-vscode"
5555
},
56-
"typescript.tsdk": "node_modules/typescript/lib"
56+
"typescript.tsdk": "node_modules/typescript/lib",
57+
"json.schemas": [
58+
{
59+
"fileMatch": ["**/_meta.json"],
60+
"url": "./website/node_modules/rspress/meta-json-schema.json"
61+
}
62+
]
5763
}

pnpm-lock.yaml

Lines changed: 453 additions & 271 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/docs/en/config/lib/dts.mdx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ Configure the generation of the TypeScript declaration files.
2626

2727
Declaration files generation is an optional feature, you can set `dts: true` to enable [bundleless declaration files](/guide/advanced/dts#bundleless-declaration-files) generation.
2828

29-
```ts title="rslib.config.ts" {5}
29+
```ts
3030
export default {
3131
lib: [
3232
{
3333
format: 'esm',
34-
dts: true,
34+
dts: true, // [!code highlight]
3535
},
3636
],
3737
};
3838
```
3939

4040
If you want to disable declaration files generation, you can set `dts: false` or do not specify the `dts` option.
4141

42-
```ts title="rslib.config.ts" {5}
42+
```ts title="rslib.config.ts"
4343
export default {
4444
lib: [
4545
{
4646
format: 'esm',
47-
dts: false,
47+
dts: false, // [!code highlight]
4848
},
4949
],
5050
};
@@ -73,14 +73,15 @@ import { PackageManagerTabs } from '@theme';
7373

7474
2. Set `dts.bundle` to `true`.
7575

76-
```ts title="rslib.config.ts" {5-7}
76+
```ts title="rslib.config.ts"
7777
export default {
7878
lib: [
7979
{
8080
format: 'esm',
8181
dts: {
82-
bundle: true,
83-
},
82+
// [!code highlight]
83+
bundle: true, // [!code highlight]
84+
}, // [!code highlight]
8485
},
8586
],
8687
};
@@ -106,14 +107,15 @@ The default value follows the priority below:
106107

107108
#### Example
108109

109-
```ts title="rslib.config.ts" {5-7}
110+
```ts title="rslib.config.ts"
110111
export default {
111112
lib: [
112113
{
113114
format: 'esm',
114115
dts: {
115-
distPath: './dist-types',
116-
},
116+
// [!code highlight]
117+
distPath: './dist-types', // [!code highlight]
118+
}, // [!code highlight]
117119
},
118120
],
119121
};
@@ -143,14 +145,15 @@ By default, type errors will cause the build to fail.
143145

144146
When `abortOnError` is set to `false` like below, the build will still succeed even if there are type issues in the code.
145147

146-
```ts title="rslib.config.ts" {5-7}
148+
```ts title="rslib.config.ts"
147149
export default {
148150
lib: [
149151
{
150152
format: 'esm',
151153
dts: {
152-
abortOnError: false,
153-
},
154+
// [!code highlight]
155+
abortOnError: false, // [!code highlight]
156+
}, // [!code highlight]
154157
},
155158
],
156159
};

website/docs/en/config/lib/external-helpers.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,21 @@ export default class FOO {
2929

3030
When `externalHelpers` is disabled, the output JavaScript will inline helper functions.
3131

32-
```ts title="rslib.config.ts" {5}
32+
```ts title="rslib.config.ts"
3333
export default {
3434
lib: [
3535
{
3636
syntax: 'es5',
37-
externalHelpers: false,
37+
externalHelpers: false, // [!code highlight]
3838
},
3939
],
4040
};
4141
```
4242

4343
Below is the output JavaScript file, the highlighted code is the inlined helper functions:
4444

45-
```js title="index.js" {1-18}
45+
```js title="index.js"
46+
// [!code highlight:18]
4647
function _class_call_check(instance, Constructor) {
4748
if (!(instance instanceof Constructor))
4849
throw new TypeError('Cannot call a class as a function');
@@ -79,22 +80,22 @@ export { src_FOO as default };
7980

8081
When `externalHelpers` is enabled, the output JavaScript will import helper functions from the external module `@swc/helpers`.
8182

82-
```ts title="rslib.config.ts" {5}
83+
```ts title="rslib.config.ts"
8384
export default {
8485
lib: [
8586
{
8687
syntax: 'es5',
87-
externalHelpers: true,
88+
externalHelpers: true, // [!code highlight]
8889
},
8990
],
9091
};
9192
```
9293

9394
Below is the output JavaScript file, the highlighted code is importing helper functions:
9495

95-
```js title="index.js" {1-2}
96-
import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__ from '@swc/helpers/_/_class_call_check';
97-
import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__ from '@swc/helpers/_/_create_class';
96+
```js title="index.js"
97+
import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_class_call_check__ from '@swc/helpers/_/_class_call_check'; // [!code highlight]
98+
import * as __WEBPACK_EXTERNAL_MODULE__swc_helpers_create_class__ from '@swc/helpers/_/_create_class'; // [!code highlight]
9899
var src_FOO = /*#__PURE__*/ (function () {
99100
'use strict';
100101
function FOO() {

website/docs/en/config/lib/umd-name.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ The module name of the UMD bundle must not conflict with the global variable nam
1515

1616
The UMD bundle will be mounted to `global.MyLibrary`.
1717

18-
```ts title="rslib.config.ts" {5}
18+
```ts title="rslib.config.ts"
1919
export default {
2020
lib: [
2121
{
2222
format: 'umd',
23-
umdName: 'MyLibrary',
23+
umdName: 'MyLibrary', // [!code highlight]
2424
},
2525
],
2626
};

website/docs/en/guide/advanced/module-federation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { defineConfig } from '@rslib/core';
3838
export default defineConfig({
3939
lib: [
4040
// ... other format
41+
// [!code highlight:35]
4142
{
4243
format: 'mf',
4344
output: {

website/docs/zh/config/lib/dts.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ type Dts =
2626

2727
类型声明文件生成是一个可选功能,你可以设置 `dts: true` 来启用 [bundleless 类型](/guide/advanced/dts#bundleless-类型) 生成。
2828

29-
```ts title="rslib.config.ts" {5}
29+
```ts title="rslib.config.ts"
3030
export default {
3131
lib: [
3232
{
3333
format: 'esm',
34-
dts: true,
34+
dts: true, // [!code highlight]
3535
},
3636
],
3737
};
3838
```
3939

4040
如果你想要禁用类型声明文件生成,可以设置 `dts: false` 或者不指定 `dts` 选项。
4141

42-
```ts title="rslib.config.ts" {5}
42+
```ts title="rslib.config.ts"
4343
export default {
4444
lib: [
4545
{
4646
format: 'esm',
47-
dts: false,
47+
dts: false, // [!code highlight]
4848
},
4949
],
5050
};
@@ -73,13 +73,13 @@ import { PackageManagerTabs } from '@theme';
7373

7474
2.`dts.bundle` 设置为 `true`
7575

76-
```ts title="rslib.config.ts" {5-7}
76+
```ts title="rslib.config.ts"
7777
export default {
7878
lib: [
7979
{
8080
format: 'esm',
8181
dts: {
82-
bundle: true,
82+
bundle: true, // [!code highlight]
8383
},
8484
},
8585
],
@@ -106,13 +106,13 @@ export default {
106106

107107
#### 示例
108108

109-
```ts title="rslib.config.ts" {5-7}
109+
```ts title="rslib.config.ts"
110110
export default {
111111
lib: [
112112
{
113113
format: 'esm',
114114
dts: {
115-
distPath: './dist-types',
115+
distPath: './dist-types', // [!code highlight]
116116
},
117117
},
118118
],
@@ -143,13 +143,13 @@ export default {
143143

144144
`abortOnError` 设置为 `false` 时(如下所示),即使代码中存在类型问题,构建仍然会成功。
145145

146-
```ts title="rslib.config.ts" {5-7}
146+
```ts title="rslib.config.ts"
147147
export default {
148148
lib: [
149149
{
150150
format: 'esm',
151151
dts: {
152-
abortOnError: false,
152+
abortOnError: false, // [!code highlight]
153153
},
154154
},
155155
],

website/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"@rsbuild/core": "1.3.15",
1313
"@rsbuild/plugin-sass": "^1.3.1",
1414
"@rslib/tsconfig": "workspace:*",
15-
"@rspress/plugin-llms": "2.0.0-beta.3",
15+
"@rspress/plugin-llms": "2.0.0-beta.5",
1616
"@rstack-dev/doc-ui": "1.8.0",
17+
"@shikijs/transformers": "^3.4.0",
1718
"@types/node": "^22.8.1",
1819
"@types/react": "^19.1.3",
1920
"@types/react-dom": "^19.1.3",
2021
"react": "^19.1.0",
2122
"react-dom": "^19.1.0",
2223
"rsbuild-plugin-google-analytics": "1.0.3",
23-
"rspress": "2.0.0-beta.3",
24+
"rspress": "2.0.0-beta.5",
2425
"rspress-plugin-font-open-sans": "1.0.0"
2526
}
2627
}

website/rspress.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'node:path';
22
import { pluginSass } from '@rsbuild/plugin-sass';
33
import { pluginLlms } from '@rspress/plugin-llms';
4+
import { transformerNotationHighlight } from '@shikijs/transformers';
45
import { pluginGoogleAnalytics } from 'rsbuild-plugin-google-analytics';
56
import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
67
import { defineConfig } from 'rspress/config';
@@ -18,6 +19,9 @@ export default defineConfig({
1819
logoText: 'Rslib',
1920
markdown: {
2021
checkDeadLinks: true,
22+
shiki: {
23+
transformers: [transformerNotationHighlight()],
24+
},
2125
},
2226
search: {
2327
codeBlocks: true,

website/theme/components/RsbuildDocBadge.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export function RsbuildDocBadge({ path, text, alt }: Props) {
1515
const href = `https://rsbuild.dev${langPrefix}${path}`;
1616

1717
return (
18-
<Link href={href} target="_blank" rel="noreferrer">
18+
<Link
19+
href={href}
20+
target="_blank"
21+
rel="noreferrer"
22+
className="rspress-toc-exclude"
23+
>
1924
<Badge type="info">
2025
<img
2126
alt={alt || text}

0 commit comments

Comments
 (0)