diff --git a/packages/core/package.json b/packages/core/package.json index e191f4511..2c82476c5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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", @@ -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/core@0.1.4", "rslog": "^1.2.3", "tsconfck": "3.1.4", diff --git a/packages/core/rslib.config.ts b/packages/core/rslib.config.ts index eaf5339c5..6c42b6e3d 100644 --- a/packages/core/rslib.config.ts +++ b/packages/core/rslib.config.ts @@ -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 = { @@ -35,7 +36,7 @@ export default defineConfig({ }, }, ], - plugins: [pluginFixDtsTypes], + plugins: [pluginFixDtsTypes, pluginPublint()], source: { entry: { index: './src/index.ts', diff --git a/packages/create-rslib/package.json b/packages/create-rslib/package.json index 7f6dea5df..549980a12 100644 --- a/packages/create-rslib/package.json +++ b/packages/create-rslib/package.json @@ -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", @@ -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/core@0.1.4", "tsx": "^4.19.2", "typescript": "^5.6.3" diff --git a/packages/create-rslib/rslib.config.ts b/packages/create-rslib/rslib.config.ts index a409aa294..b34740e24 100644 --- a/packages/create-rslib/rslib.config.ts +++ b/packages/create-rslib/rslib.config.ts @@ -1,5 +1,7 @@ +import { pluginPublint } from 'rsbuild-plugin-publint'; import { defineConfig } from 'rslib'; export default defineConfig({ lib: [{ format: 'esm' }], + plugins: [pluginPublint()], }); diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index 5fbacf59e..3242641bf 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -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", @@ -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/core@0.1.4", "typescript": "^5.6.3" }, diff --git a/packages/plugin-dts/rslib.config.ts b/packages/plugin-dts/rslib.config.ts index 59a08f3d2..6fc57503d 100644 --- a/packages/plugin-dts/rslib.config.ts +++ b/packages/plugin-dts/rslib.config.ts @@ -1,3 +1,4 @@ +import { pluginPublint } from 'rsbuild-plugin-publint'; import { defineConfig } from 'rslib'; export default defineConfig({ @@ -16,4 +17,5 @@ export default defineConfig({ index: ['./src/**'], }, }, + plugins: [pluginPublint()], }); diff --git a/packages/plugin-dts/src/index.ts b/packages/plugin-dts/src/index.ts index 59da529cc..b7fba3def 100644 --- a/packages/plugin-dts/src/index.ts +++ b/packages/plugin-dts/src/index.ts @@ -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', }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ab49422f..526b09bbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -295,6 +295,9 @@ importers: prebundle: specifier: 1.2.5 version: 1.2.5(typescript@5.6.3) + rsbuild-plugin-publint: + specifier: ^0.2.1 + version: 0.2.1(@rsbuild/core@1.1.10) rslib: specifier: npm:@rslib/core@0.1.4 version: '@rslib/core@0.1.4(@microsoft/api-extractor@7.48.1(@types/node@22.8.1))(typescript@5.6.3)' @@ -329,6 +332,9 @@ importers: fs-extra: specifier: ^11.2.0 version: 11.2.0 + rsbuild-plugin-publint: + specifier: ^0.2.1 + version: 0.2.1(@rsbuild/core@1.1.10) rslib: specifier: npm:@rslib/core@0.1.4 version: '@rslib/core@0.1.4(@microsoft/api-extractor@7.48.1(@types/node@22.8.1))(typescript@5.6.3)' @@ -360,6 +366,9 @@ importers: '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig + rsbuild-plugin-publint: + specifier: ^0.2.1 + version: 0.2.1(@rsbuild/core@1.1.10) rslib: specifier: npm:@rslib/core@0.1.4 version: '@rslib/core@0.1.4(@microsoft/api-extractor@7.48.1(@types/node@22.8.1))(typescript@5.6.3)' @@ -3782,6 +3791,11 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported + glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} + deprecated: Glob versions prior to v9 are no longer supported + global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} engines: {node: '>=0.10.0'} @@ -3973,6 +3987,10 @@ packages: ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore-walk@5.0.1: + resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} @@ -4612,6 +4630,10 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} + minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} @@ -4697,6 +4719,19 @@ packages: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} + npm-bundled@2.0.1: + resolution: {integrity: sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + + npm-normalize-package-bin@2.0.0: + resolution: {integrity: sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + + npm-packlist@5.1.3: + resolution: {integrity: sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + hasBin: true + npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} @@ -5089,6 +5124,11 @@ packages: public-encrypt@4.0.3: resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} + publint@0.2.12: + resolution: {integrity: sha512-YNeUtCVeM4j9nDiTT2OPczmlyzOkIXNtdDZnSuajAxS/nZ6j3t7Vs9SUB4euQNddiltIwu7Tdd3s+hr08fAsMw==} + engines: {node: '>=16'} + hasBin: true + punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} @@ -5379,6 +5419,14 @@ packages: '@rsbuild/core': optional: true + rsbuild-plugin-publint@0.2.1: + resolution: {integrity: sha512-iD/qeXWHmx2KKRT3cZ0lWa6Nz+K3NWFkVBfq+NQC3LAtHZCMftBbUzbjbJsjDiH195PVPdPmy+5qbxLf6HYqKg==} + peerDependencies: + '@rsbuild/core': 1.x + peerDependenciesMeta: + '@rsbuild/core': + optional: true + rslog@1.2.3: resolution: {integrity: sha512-antALPJaKBRPBU1X2q9t085K4htWDOOv/K1qhTUk7h0l1ePU/KbDqKJn19eKP0dk7PqMioeA0+fu3gyPXCsXxQ==} engines: {node: '>=14.17.6'} @@ -9717,6 +9765,14 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 + glob@8.1.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 5.1.6 + once: 1.4.0 + global-modules@1.0.0: dependencies: global-prefix: 1.0.2 @@ -10000,6 +10056,10 @@ snapshots: ieee754@1.2.1: {} + ignore-walk@5.0.1: + dependencies: + minimatch: 5.1.6 + ignore@5.3.1: {} immutable@5.0.2: {} @@ -10841,6 +10901,10 @@ snapshots: dependencies: brace-expansion: 1.1.11 + minimatch@5.1.6: + dependencies: + brace-expansion: 2.0.1 + minimatch@9.0.3: dependencies: brace-expansion: 2.0.1 @@ -10910,6 +10974,19 @@ snapshots: normalize-path@3.0.0: {} + npm-bundled@2.0.1: + dependencies: + npm-normalize-package-bin: 2.0.0 + + npm-normalize-package-bin@2.0.0: {} + + npm-packlist@5.1.3: + dependencies: + glob: 8.1.0 + ignore-walk: 5.0.1 + npm-bundled: 2.0.1 + npm-normalize-package-bin: 2.0.0 + npm-run-path@4.0.1: dependencies: path-key: 3.1.1 @@ -11340,6 +11417,12 @@ snapshots: randombytes: 2.1.0 safe-buffer: 5.2.1 + publint@0.2.12: + dependencies: + npm-packlist: 5.1.3 + picocolors: 1.1.1 + sade: 1.8.1 + punycode@1.4.1: {} punycode@2.3.1: {} @@ -11697,6 +11780,13 @@ snapshots: optionalDependencies: '@rsbuild/core': 1.1.10 + rsbuild-plugin-publint@0.2.1(@rsbuild/core@1.1.10): + dependencies: + picocolors: 1.1.1 + publint: 0.2.12 + optionalDependencies: + '@rsbuild/core': 1.1.10 + rslog@1.2.3: {} rspack-plugin-virtual-module@0.1.13: diff --git a/scripts/dictionary.txt b/scripts/dictionary.txt index 72e884d9b..800513793 100644 --- a/scripts/dictionary.txt +++ b/scripts/dictionary.txt @@ -90,6 +90,7 @@ prebundle preflights prefresh preprocessors +publint pxtorem quxx rebranded @@ -135,10 +136,10 @@ unpatch unplugin unpredictibly unshift +unstubAllEnvs upath vitest vnode watchpack webm webp -unstubAllEnvs \ No newline at end of file