Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:

- run: bun install --frozen-lockfile

# No unpublished @workbench/* scope may leak in — it does not exist on
# npm, so a leak makes the package uninstallable outside the monorepo.
- name: check-deps
run: bun run scripts/check-deps.ts

# typecheck builds first: examples import @corbits/artifacts through the
# published dist types, same path a consumer resolves.
- name: typecheck
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ always called out under their own heading.

### Changed

- `@intx/agent` is an optional peer. Only `@corbits/artifacts/sidecar-bundle`
imports it, so a host that mounts the routes alone need not install it.
- `arktype` is a regular dependency (`^2.2.3`) instead of a peer, so hosts no
longer install it themselves. The exported query schemas are still arktype
types; a host on another arktype version gets its own copy alongside.
- Minimum `@intx/*` is now **0.3.0**. (`@intx/*` lines before 0.3.0 do not
install — older lines pin the unpublished `@intx/*@0.0.0` or ship raw
TypeScript.)
Expand Down Expand Up @@ -119,6 +124,10 @@ always called out under their own heading.

### Breaking

- The drizzle tables (`artifact`, `artifactVersion`, `upload`,
`mailAttachmentRef`) are no longer exported from the package entry. Hosts
reach artifacts through the routes and functions; `ARTIFACTS_SCHEMA` and the
`*Row` types stay public.
- `mountArtifacts` takes `Hono<TenantEnv>`, reads the host-provided tenant and
principal context natively, and requires the host's Interchange `RequireGrant`
middleware. The `resolvePrincipal`, `isAdmin`, and `identity` options and the
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ docker run -d --name corbits-artifact-pg -p 5457:5432 \
export ALLOW_DESTRUCTIVE_ARTIFACT_TESTS=1

bun run typecheck
bun run test # pretest dependency check, then unit + integration
bun run test # unit + integration
bun run build # dist/ (JS + .d.ts)
bun run test:acceptance # builds, then examples/reference-host
```
Expand Down Expand Up @@ -53,8 +53,7 @@ reference host is where that change has to be shown working.
## Dependency rule

No `@workbench/*` imports anywhere — it is an unpublished scope, and importing it would
make this package uninstallable outside the project that defines it. Checked by
`scripts/check-deps.ts`, which runs as `pretest` and again in CI.
make this package uninstallable outside the project that defines it.

## Tests

Expand All @@ -76,15 +75,16 @@ rendered SQL, so editing one that has already been applied fails with
`MigrationChecksumError` on the next boot rather than letting fresh and existing
databases diverge. Add a new migration instead.

`schema.ts` and `migrations.ts` must agree — the drizzle table objects are public
exports, and a test asserts the migrations create exactly the tables `schema.ts`
declares, no more and no less. Change one, change the other, in the same commit.
`schema.ts` and `migrations.ts` must agree — every query goes through the drizzle
table objects, and a test asserts the migrations create exactly the tables
`schema.ts` declares, no more and no less. Change one, change the other, in the
same commit.

## Pull requests

- Keep commits focused, and keep the diff to the change you are describing.
- Explain *why* in the commit message; the code already says what.
- CI must be green: dependency check, typecheck, unit + integration, build, reference-host
- CI must be green: typecheck, unit + integration, build, reference-host
acceptance, and a Node consumer smoke test that installs the packed tarball.
- Contributions are accepted under the repository's LGPL-2.1-only licence.

Expand Down
14 changes: 8 additions & 6 deletions bun.lock

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

1 change: 0 additions & 1 deletion examples/reference-host/bun.lock

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

1 change: 0 additions & 1 deletion examples/reference-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@intx/hub-common": "0.4.0",
"@intx/hub-sessions": "0.4.0",
"@intx/types": "0.4.0",
"arktype": "2.1.29",
"drizzle-orm": "0.45.2",
"hono": "4.12.32",
"hono-openapi": "1.2.0",
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,32 @@
"typecheck": "tsc --noEmit",
"build": "rm -rf dist && tsc -p tsconfig.build.json",
"prepack": "bun run build",
"pretest": "bun run scripts/check-deps.ts",
"test": "bun run pretest && bun test src",
"test:coverage": "bun run pretest && bun test --coverage src",
"test:package": "bun run test",
"test": "bun test src",
"test:coverage": "bun test --coverage src",
"test:acceptance": "bun run build && bun test --cwd examples/reference-host"
},
"dependencies": {
"@hono/standard-validator": "^0.2.3"
"@hono/standard-validator": "^0.2.3",
"arktype": "^2.2.3"
},
"peerDependencies": {
"@intx/types": "^0.4.0",
"arktype": "^2.1.29",
"drizzle-orm": "^0.45.2",
"hono": "^4.12.32",
"hono-openapi": "^1.2.0",
"postgres": "^3.4.9",
"@intx/hub-api": "^0.4.0",
"@intx/agent": "^0.4.0"
},
"peerDependenciesMeta": {
"@intx/agent": {
"optional": true
}
},
"devDependencies": {
"@intx/types": "0.4.0",
"@types/bun": "1.1.14",
"@types/node": "22.10.5",
"arktype": "2.1.29",
"drizzle-orm": "0.45.2",
"hono": "4.12.32",
"hono-openapi": "1.2.0",
Expand Down
19 changes: 0 additions & 19 deletions scripts/check-deps.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ export type { RunArtifactMigrationsOptions } from "./migrations.js";
export { createArtifactDb } from "./db.js";
export type { ArtifactDb, ArtifactTx } from "./db.js";

export {
ARTIFACTS_SCHEMA,
artifact,
artifactVersion,
upload,
mailAttachmentRef,
} from "./schema.js";
export { ARTIFACTS_SCHEMA } from "./schema.js";
export type {
ArtifactRow,
ArtifactVersionRow,
Expand Down
Loading