From 2b70b7c4d4402587fbbf55759a01a0569c749314 Mon Sep 17 00:00:00 2001 From: Rieranthony Date: Thu, 30 Jul 2026 12:50:04 +0200 Subject: [PATCH] chore(release): gate SDK tests in CI and fix protocol publish target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two release-hygiene gaps found while auditing #161. CI never ran the SDK regression suites. @cossistant/{react,core,types,next, browser} had no `test` script, so `turbo run test` skipped them and the suites only ever ran locally. #161 adds the `test` scripts; this adds the CI step that consumes them, so the provider-lifecycle, data-hook and embed regressions gate merges instead of relying on someone running `bun test` by hand. The step is a no-op until #161 lands (no `test` task to run, so turbo executes nothing and passes), and becomes meaningful the moment it does — 473 tests across the five packages. @cossistant/protocol's pub:* scripts used bare `npm publish`, which ignores publishConfig.directory. With `files: ["dist"]` the tarball root package.json still pointed main/exports at ./src/*.ts, which is excluded from the tarball, so all 12 entry points resolved to missing files. #161 fixed this for react, next and browser; #161's follow-up commit fixed core, types and tiny-markdown. protocol is the last one. `changeset publish` (the CI release path) was never affected: it honours publishConfig.directory. Co-Authored-By: Claude Opus 5 --- .github/workflows/ci.yml | 12 ++++++++++++ packages/protocol/package.json | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2a99729..c230451d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,18 @@ jobs: - name: Test protocol package run: bun run test --filter @cossistant/protocol + # The SDK regression suites pin the provider lifecycle, data-hook and + # embed behaviour. They are the safety net for the published packages, so + # they gate merges rather than relying on a local `bun test` run. + - name: Test SDK packages + run: >- + bun run test + --filter @cossistant/react + --filter @cossistant/core + --filter @cossistant/types + --filter @cossistant/next + --filter @cossistant/browser + - name: Test REST OpenAPI contract # Run this file on its own: bun's mock.module registrations are global to # the test process, so partial factories in other files leak across a diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 61fadb9e..bb0ffd6d 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -49,9 +49,9 @@ "generate:openapi": "bun run scripts/generate-openapi.ts", "check:openapi": "bun run scripts/generate-openapi.ts --check", "prepare-package": "bun ../../scripts/prepare-package.ts", - "pub:release": "bun run build && npm publish --access public", - "pub:beta": "bun run build && npm publish --access public --tag beta --no-git-checks", - "pub:next": "bun run build && npm publish --access public --tag next --no-git-checks", + "pub:release": "bun run build && npm publish ./dist --access public", + "pub:beta": "bun run build && npm publish ./dist --access public --tag beta --no-git-checks", + "pub:next": "bun run build && npm publish ./dist --access public --tag next --no-git-checks", "lint": "biome check .", "test": "bun test src", "check-types": "tsc --noEmit --project tsconfig.json"