Skip to content

Commit 371bc29

Browse files
committed
fix(ci): unblock typecheck and destructive test gate
typecheck imports examples through @corbits/artifacts dist types, so build first. Wire ALLOW_DESTRUCTIVE_ARTIFACT_TESTS=1 into CI so the TRUNCATE/DROP gate the suite now enforces can actually run. Align the reference-host decorate callback with the readonly base row type from the list/detail split.
1 parent 36163d5 commit 371bc29

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
2525
env:
2626
ARTIFACT_DATABASE_URL: postgres://postgres:postgres@localhost:5457/artifact_core
27+
# Package suite TRUNCATEs tables / some migration tests DROP SCHEMA — both
28+
# refuse unless opted in against an allowlisted ephemeral database name.
29+
ALLOW_DESTRUCTIVE_ARTIFACT_TESTS: "1"
2730

2831
steps:
2932
- uses: actions/checkout@v4
@@ -38,14 +41,17 @@ jobs:
3841
- name: check-deps
3942
run: bun run --cwd packages/artifacts scripts/check-deps.ts
4043

44+
# typecheck builds first: examples import @corbits/artifacts through the
45+
# published dist types, same path a consumer resolves.
4146
- name: typecheck
4247
run: bun run typecheck
4348

4449
- name: unit + integration tests
4550
run: bun run --cwd packages/artifacts test:coverage
4651

47-
# Emits dist/, which is also what the reference host resolves through —
48-
# so this proves the published artifact, not just the sources.
52+
# dist/ is already emitted by typecheck; re-run for a clean package build
53+
# so acceptance and the node consumer smoke test do not depend on typecheck
54+
# having side-effected the tree.
4955
- name: build
5056
run: bun run build
5157

‎examples/reference-host/src/index.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {
3434
type ResolvedPrincipal,
3535
type ContentStore,
3636
type Identity,
37-
type SerializedArtifact,
37+
type SerializedArtifactBase,
3838
} from "@corbits/artifacts";
3939

4040
export const DATABASE_URL =
@@ -130,7 +130,7 @@ function createIdentity(db: ArtifactDb): Identity {
130130
}
131131

132132
/** Display-only decorator. Adds a label, never changes what is returned. */
133-
async function decorate(_tenantId: string, rows: SerializedArtifact[]) {
133+
async function decorate(_tenantId: string, rows: readonly SerializedArtifactBase[]) {
134134
for (const row of rows) {
135135
(row as Record<string, unknown>).generatedByLabel =
136136
typeof row.source.generatedBy === "string" ? row.source.generatedBy : null;

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"examples/*"
88
],
99
"scripts": {
10-
"typecheck": "tsc --noEmit",
10+
"typecheck": "bun run build && tsc --noEmit",
1111
"build": "bun run --cwd packages/artifacts build",
1212
"test": "bun run test:package && bun run test:acceptance",
1313
"test:package": "bun run --cwd packages/artifacts test",

0 commit comments

Comments
 (0)