Skip to content

Commit 72587ed

Browse files
authored
build: add rsbuild-plugin-publint (#569)
1 parent 3d5312d commit 72587ed

File tree

9 files changed

+106
-5
lines changed

9 files changed

+106
-5
lines changed

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/web-infra-dev/rslib",
11+
"url": "git+https://github.com/web-infra-dev/rslib.git",
1212
"directory": "packages/core"
1313
},
1414
"license": "MIT",
@@ -50,6 +50,7 @@
5050
"memfs": "^4.15.0",
5151
"picocolors": "1.1.1",
5252
"prebundle": "1.2.5",
53+
"rsbuild-plugin-publint": "^0.2.1",
5354
"rslib": "npm:@rslib/[email protected]",
5455
"rslog": "^1.2.3",
5556
"tsconfck": "3.1.4",

packages/core/rslib.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
33
import type { RsbuildPlugin } from '@rsbuild/core';
4+
import { pluginPublint } from 'rsbuild-plugin-publint';
45
import { defineConfig } from 'rslib';
56

67
const pluginFixDtsTypes: RsbuildPlugin = {
@@ -35,7 +36,7 @@ export default defineConfig({
3536
},
3637
},
3738
],
38-
plugins: [pluginFixDtsTypes],
39+
plugins: [pluginFixDtsTypes, pluginPublint()],
3940
source: {
4041
entry: {
4142
index: './src/index.ts',

packages/create-rslib/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://lib.rsbuild.dev",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/web-infra-dev/rslib",
8+
"url": "git+https://github.com/web-infra-dev/rslib.git",
99
"directory": "packages/create-rslib"
1010
},
1111
"license": "MIT",
@@ -37,6 +37,7 @@
3737
"@types/fs-extra": "^11.0.4",
3838
"@types/node": "^22.8.1",
3939
"fs-extra": "^11.2.0",
40+
"rsbuild-plugin-publint": "^0.2.1",
4041
"rslib": "npm:@rslib/[email protected]",
4142
"tsx": "^4.19.2",
4243
"typescript": "^5.6.3"

packages/create-rslib/rslib.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { pluginPublint } from 'rsbuild-plugin-publint';
12
import { defineConfig } from 'rslib';
23

34
export default defineConfig({
45
lib: [{ format: 'esm' }],
6+
plugins: [pluginPublint()],
57
});

packages/plugin-dts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "https://github.com/web-infra-dev/rslib",
11+
"url": "git+https://github.com/web-infra-dev/rslib.git",
1212
"directory": "packages/plugin-dts"
1313
},
1414
"license": "MIT",
@@ -37,6 +37,7 @@
3737
"@microsoft/api-extractor": "^7.48.1",
3838
"@rsbuild/core": "~1.1.10",
3939
"@rslib/tsconfig": "workspace:*",
40+
"rsbuild-plugin-publint": "^0.2.1",
4041
"rslib": "npm:@rslib/[email protected]",
4142
"typescript": "^5.6.3"
4243
},

packages/plugin-dts/rslib.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { pluginPublint } from 'rsbuild-plugin-publint';
12
import { defineConfig } from 'rslib';
23

34
export default defineConfig({
@@ -16,4 +17,5 @@ export default defineConfig({
1617
index: ['./src/**'],
1718
},
1819
},
20+
plugins: [pluginPublint()],
1921
});

packages/plugin-dts/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
161161
}
162162
}
163163
},
164+
// Set the order to 'post' to ensure that when DTS files of multiple formats are generated
165+
// simultaneously, all errors are thrown together before exiting the process.
164166
order: 'post',
165167
});
166168

pnpm-lock.yaml

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

scripts/dictionary.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ prebundle
9090
preflights
9191
prefresh
9292
preprocessors
93+
publint
9394
pxtorem
9495
quxx
9596
rebranded
@@ -135,10 +136,10 @@ unpatch
135136
unplugin
136137
unpredictibly
137138
unshift
139+
unstubAllEnvs
138140
upath
139141
vitest
140142
vnode
141143
watchpack
142144
webm
143145
webp
144-
unstubAllEnvs

0 commit comments

Comments
 (0)