Skip to content
Merged
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: 5 additions & 0 deletions .changeset/trl-938-native-bun-release-binding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ontrails/trails": patch
---

Expose the native Bun release binding from `@ontrails/trails/release` and keep publish and registry scripts as compatibility wrappers.
1 change: 1 addition & 0 deletions apps/trails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@ontrails/warden": "workspace:^",
"@ontrails/wayfinder": "workspace:^",
"commander": "catalog:",
"typescript": "^5.9.3",
"zod": "catalog:"
},
"devDependencies": {
Expand Down
34 changes: 34 additions & 0 deletions apps/trails/src/__tests__/release-bindings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { describe, expect, test } from 'bun:test';

import {
nativeBunReleaseBinding,
releaseBindingCapabilityValues,
releaseBindingKindValues,
releaseBindingPlacementValues,
} from '../release/index.js';

describe('release bindings', () => {
test('declares the native Bun release binding as the built-in default', () => {
expect(releaseBindingKindValues).toEqual(['native', 'adapter']);
expect(releaseBindingPlacementValues).toEqual([
'same-package',
'subpath',
'extracted',
]);
expect(releaseBindingCapabilityValues).toEqual([
'pack-check',
'publish',
'registry-preflight',
]);
expect(nativeBunReleaseBinding).toEqual({
boundary: 'trails-owned',
capabilities: ['pack-check', 'publish', 'registry-preflight'],
description:
'Built-in Bun release binding for Trails-owned package pack checks, npm registry preflight, and lockstep package publication.',
id: 'release.binding.native-bun',
kind: 'native',
placement: 'same-package',
runtime: 'bun',
});
});
});
39 changes: 39 additions & 0 deletions apps/trails/src/release/bindings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export const releaseBindingKindValues = ['native', 'adapter'] as const;
export type ReleaseBindingKind = (typeof releaseBindingKindValues)[number];

export const releaseBindingPlacementValues = [
'same-package',
'subpath',
'extracted',
] as const;
export type ReleaseBindingPlacement =
(typeof releaseBindingPlacementValues)[number];

export const releaseBindingCapabilityValues = [
'pack-check',
'publish',
'registry-preflight',
] as const;
export type ReleaseBindingCapability =
(typeof releaseBindingCapabilityValues)[number];

export interface ReleaseBindingDescriptor {
readonly boundary: 'foreign' | 'trails-owned';
readonly capabilities: readonly ReleaseBindingCapability[];
readonly description: string;
readonly id: string;
readonly kind: ReleaseBindingKind;
readonly placement: ReleaseBindingPlacement;
readonly runtime: string;
}

export const nativeBunReleaseBinding = {
boundary: 'trails-owned',
capabilities: ['pack-check', 'publish', 'registry-preflight'],
description:
'Built-in Bun release binding for Trails-owned package pack checks, npm registry preflight, and lockstep package publication.',
id: 'release.binding.native-bun',
kind: 'native',
placement: 'same-package',
runtime: 'bun',
} satisfies ReleaseBindingDescriptor;
29 changes: 29 additions & 0 deletions apps/trails/src/release/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export {
nativeBunReleaseBinding,
releaseBindingCapabilityValues,
releaseBindingKindValues,
releaseBindingPlacementValues,
type ReleaseBindingCapability,
type ReleaseBindingDescriptor,
type ReleaseBindingKind,
type ReleaseBindingPlacement,
} from './bindings.js';
export {
checkReleaseRules,
discoverWorkspaces,
Expand Down Expand Up @@ -39,3 +49,22 @@ export {
type ReleaseRule,
type ReleaseRuleInput,
} from './config.js';
export {
findPackedFirstPartyDependencyMismatches,
runNativeBunPublishCli,
type NativeBunPublishOptions,
type NativeBunPublishPackageJson,
type NativeBunPublishWorkspace,
} from './native-bun-publish.js';
export {
checkRegistryPosture,
discoverRegistryWorkspaces,
formatDistTagSummary,
registryPostureErrors,
runRegistryPreflight,
runRegistryPreflightCli,
type RegistryPreflightOptions,
type RegistryResult,
type RegistryView,
type RegistryWorkspace,
} from './native-bun-registry.js';
Loading
Loading