Skip to content

Commit

Permalink
build: add rsbuild-plugin-publint (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored Dec 17, 2024
1 parent 3d5312d commit 72587ed
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/web-infra-dev/rslib",
"url": "git+https://github.com/web-infra-dev/rslib.git",
"directory": "packages/core"
},
"license": "MIT",
Expand Down Expand Up @@ -50,6 +50,7 @@
"memfs": "^4.15.0",
"picocolors": "1.1.1",
"prebundle": "1.2.5",
"rsbuild-plugin-publint": "^0.2.1",
"rslib": "npm:@rslib/[email protected]",
"rslog": "^1.2.3",
"tsconfck": "3.1.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';
import type { RsbuildPlugin } from '@rsbuild/core';
import { pluginPublint } from 'rsbuild-plugin-publint';
import { defineConfig } from 'rslib';

const pluginFixDtsTypes: RsbuildPlugin = {
Expand Down Expand Up @@ -35,7 +36,7 @@ export default defineConfig({
},
},
],
plugins: [pluginFixDtsTypes],
plugins: [pluginFixDtsTypes, pluginPublint()],
source: {
entry: {
index: './src/index.ts',
Expand Down
3 changes: 2 additions & 1 deletion packages/create-rslib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://lib.rsbuild.dev",
"repository": {
"type": "git",
"url": "https://github.com/web-infra-dev/rslib",
"url": "git+https://github.com/web-infra-dev/rslib.git",
"directory": "packages/create-rslib"
},
"license": "MIT",
Expand Down Expand Up @@ -37,6 +37,7 @@
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.8.1",
"fs-extra": "^11.2.0",
"rsbuild-plugin-publint": "^0.2.1",
"rslib": "npm:@rslib/[email protected]",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
Expand Down
2 changes: 2 additions & 0 deletions packages/create-rslib/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { pluginPublint } from 'rsbuild-plugin-publint';
import { defineConfig } from 'rslib';

export default defineConfig({
lib: [{ format: 'esm' }],
plugins: [pluginPublint()],
});
3 changes: 2 additions & 1 deletion packages/plugin-dts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/web-infra-dev/rslib",
"url": "git+https://github.com/web-infra-dev/rslib.git",
"directory": "packages/plugin-dts"
},
"license": "MIT",
Expand Down Expand Up @@ -37,6 +37,7 @@
"@microsoft/api-extractor": "^7.48.1",
"@rsbuild/core": "~1.1.10",
"@rslib/tsconfig": "workspace:*",
"rsbuild-plugin-publint": "^0.2.1",
"rslib": "npm:@rslib/[email protected]",
"typescript": "^5.6.3"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-dts/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { pluginPublint } from 'rsbuild-plugin-publint';
import { defineConfig } from 'rslib';

export default defineConfig({
Expand All @@ -16,4 +17,5 @@ export default defineConfig({
index: ['./src/**'],
},
},
plugins: [pluginPublint()],
});
2 changes: 2 additions & 0 deletions packages/plugin-dts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
}
}
},
// Set the order to 'post' to ensure that when DTS files of multiple formats are generated
// simultaneously, all errors are thrown together before exiting the process.
order: 'post',
});

Expand Down
90 changes: 90 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scripts/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ prebundle
preflights
prefresh
preprocessors
publint
pxtorem
quxx
rebranded
Expand Down Expand Up @@ -135,10 +136,10 @@ unpatch
unplugin
unpredictibly
unshift
unstubAllEnvs
upath
vitest
vnode
watchpack
webm
webp
unstubAllEnvs

0 comments on commit 72587ed

Please sign in to comment.