From f71ef65834a263b6dbc7f37d21263be6af99af09 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Thu, 3 Sep 2026 00:38:04 +0000 Subject: [PATCH] chore(build): gate published packages with publint --- package.json | 1 + packages/agent-bundle/rslib.config.ts | 3 +++ packages/create-agent-bundle/rslib.config.ts | 3 +++ packages/rsc-runtime/rslib.config.ts | 3 +++ pnpm-lock.yaml | 18 ++++++++++++++++++ 5 files changed, 28 insertions(+) diff --git a/package.json b/package.json index fd88856b9..b401353b8 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "playwright": "1.62.1", "playwright-core": "1.62.1", "publint": "0.3.24", + "rsbuild-plugin-publint": "1.0.0", "typescript": "7.0.2" } } diff --git a/packages/agent-bundle/rslib.config.ts b/packages/agent-bundle/rslib.config.ts index 1e6019460..0cc8c0e87 100644 --- a/packages/agent-bundle/rslib.config.ts +++ b/packages/agent-bundle/rslib.config.ts @@ -1,6 +1,7 @@ import { resolve } from 'node:path'; import { defineConfig } from '@rslib/core'; +import { pluginPublint } from 'rsbuild-plugin-publint'; import packageManifest from './package.json' with { type: 'json' }; export default defineConfig({ @@ -21,6 +22,8 @@ export default defineConfig({ legalComments: 'linked', target: 'node', }, + // Suggestions stay informational; errors and warnings block publishing. + plugins: [pluginPublint({ throwOn: 'warning' })], root: import.meta.dirname, source: { tsconfigPath: './tsconfig.build.json', diff --git a/packages/create-agent-bundle/rslib.config.ts b/packages/create-agent-bundle/rslib.config.ts index c8334305a..41486be6e 100644 --- a/packages/create-agent-bundle/rslib.config.ts +++ b/packages/create-agent-bundle/rslib.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from '@rslib/core'; +import { pluginPublint } from 'rsbuild-plugin-publint'; /** * Single self-contained ESM bundle: `@clack/prompts` is a devDependency so @@ -20,6 +21,8 @@ export default defineConfig({ filenameHash: false, target: 'node', }, + // Suggestions stay informational; errors and warnings block publishing. + plugins: [pluginPublint({ throwOn: 'warning' })], root: import.meta.dirname, source: { entry: { diff --git a/packages/rsc-runtime/rslib.config.ts b/packages/rsc-runtime/rslib.config.ts index 8219579b3..b79e901f7 100644 --- a/packages/rsc-runtime/rslib.config.ts +++ b/packages/rsc-runtime/rslib.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from '@rslib/core'; +import { pluginPublint } from 'rsbuild-plugin-publint'; const sharedLib = { bundle: true, @@ -84,6 +85,8 @@ export default defineConfig({ filenameHash: false, target: 'node', }, + // Suggestions stay informational; errors and warnings block publishing. + plugins: [pluginPublint({ throwOn: 'warning' })], root: import.meta.dirname, source: { tsconfigPath: './tsconfig.build.json', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 094830f13..03389ebd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,6 +77,9 @@ importers: publint: specifier: 0.3.24 version: 0.3.24 + rsbuild-plugin-publint: + specifier: 1.0.0 + version: 1.0.0(@rsbuild/core@2.2.1) typescript: specifier: 7.0.2 version: 7.0.2 @@ -2431,6 +2434,15 @@ packages: typescript: optional: true + rsbuild-plugin-publint@1.0.0: + resolution: {integrity: sha512-QNu6zL0TOmFZfrCiKSmkw092jDhhPpiA1QYDRkvhkW1wDLowuVEYOqdV87Eo/I6geV0nuKKnCgLHT+Fevbz6pA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rsbuild/core': ^1.0.0 || ^2.0.0-0 + peerDependenciesMeta: + '@rsbuild/core': + optional: true + rsbuild-plugin-rsc@0.1.1: resolution: {integrity: sha512-aDITXfKR7D6LudDZeErVIzftgVRK6qoA77Mt/Lnp90qXgRRT3X63yOq4bx8bRPeFXIp1Rp+KS3VJq1K9oWmkMQ==} peerDependencies: @@ -4852,6 +4864,12 @@ snapshots: optionalDependencies: typescript: 7.0.2 + rsbuild-plugin-publint@1.0.0(@rsbuild/core@2.2.1): + dependencies: + publint: 0.3.24 + optionalDependencies: + '@rsbuild/core': 2.2.1 + rsbuild-plugin-rsc@0.1.1(@rsbuild/core@2.2.1)(react-server-dom-rspack@0.1.0(@rspack/core@2.2.1(@swc/helpers@0.5.23))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)): dependencies: '@rsbuild/core': 2.2.1