GeezerVison is showing github.com — feat(schema): publish package · jonBoone/opencode@5e47501
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bun.lock +2Lines changed: 2 additions & 0 deletions Collapse file Copy file name to clipboard +15-2Lines changed: 15 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "$schema": "https://json.schemastore.org/package.json", | 3 | 3 | "name": "@opencode-ai/schema", | 4 | | - "private": true, | | 4 | + "version": "1.17.11", | 5 | 5 | "type": "module", | 6 | 6 | "license": "MIT", | | 7 | + "repository": { | | 8 | + "type": "git", | | 9 | + "url": "git+https://github.com/anomalyco/opencode.git", | | 10 | + "directory": "packages/schema" | | 11 | + }, | | 12 | + "publishConfig": { | | 13 | + "access": "public" | | 14 | + }, | | 15 | + "files": [ | | 16 | + "dist" | | 17 | + ], | 7 | 18 | "exports": { | 8 | 19 | ".": "./src/index.ts", | 9 | 20 | "./*": "./src/*.ts" | 10 | 21 | }, | 11 | 22 | "scripts": { | | 23 | + "build": "bun run script/build.ts", | 12 | 24 | "typecheck": "tsgo --noEmit" | 13 | 25 | }, | 14 | 26 | "dependencies": { | | 17 | 29 | "devDependencies": { | 18 | 30 | "@tsconfig/bun": "catalog:", | 19 | 31 | "@types/bun": "catalog:", | 20 | | - "@typescript/native-preview": "catalog:" | | 32 | + "@typescript/native-preview": "catalog:", | | 33 | + "typescript": "catalog:" | 21 | 34 | } | 22 | 35 | } |
Collapse file Copy file name to clipboard +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env bun | | 2 | + | | 3 | +import { $ } from "bun" | | 4 | +import { fileURLToPath } from "node:url" | | 5 | + | | 6 | +process.chdir(fileURLToPath(new URL("..", import.meta.url))) | | 7 | + | | 8 | +await $`rm -rf dist` | | 9 | +await $`bun tsc -p tsconfig.build.json` |
Collapse file Copy file name to clipboard +45Lines changed: 45 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env bun | | 2 | + | | 3 | +import { Script } from "@opencode-ai/script" | | 4 | +import { $ } from "bun" | | 5 | +import { rm } from "node:fs/promises" | | 6 | +import { fileURLToPath } from "node:url" | | 7 | + | | 8 | +process.chdir(fileURLToPath(new URL("..", import.meta.url))) | | 9 | + | | 10 | +const originalText = await Bun.file("package.json").text() | | 11 | +const pkg = JSON.parse(originalText) as { | | 12 | + name: string | | 13 | + version: string | | 14 | + exports: Record<string, string | { import: string; types: string }> | | 15 | +} | | 16 | +const tarball = `${pkg.name.replace("@", "").replace("/", "-")}-${pkg.version}.tgz` | | 17 | + | | 18 | +if ((await $`npm view ${pkg.name}@${pkg.version} version`.nothrow()).exitCode === 0) { | | 19 | + console.log(`already published ${pkg.name}@${pkg.version}`) | | 20 | + process.exit(0) | | 21 | +} | | 22 | + | | 23 | +try { | | 24 | + await $`bun run typecheck` | | 25 | + await $`bun run build` | | 26 | + pkg.exports = Object.fromEntries( | | 27 | + Object.entries(pkg.exports).map(([key, value]) => { | | 28 | + if (typeof value !== "string") return [key, value] | | 29 | + return [ | | 30 | + key, | | 31 | + { | | 32 | + import: value.replace("./src/", "./dist/").replace(/\.ts$/, ".js"), | | 33 | + types: value.replace("./src/", "./dist/").replace(/\.ts$/, ".d.ts"), | | 34 | + }, | | 35 | + ] | | 36 | + }), | | 37 | + ) | | 38 | + await Bun.write("package.json", JSON.stringify(pkg, null, 2) + "\n") | | 39 | + await rm(tarball, { force: true }) | | 40 | + await $`bun pm pack` | | 41 | + await $`npm publish ${tarball} --tag ${Script.channel} --access public` | | 42 | +} finally { | | 43 | + await Bun.write("package.json", originalText) | | 44 | + await rm(tarball, { force: true }) | | 45 | +} |
Collapse file Copy file name to clipboardExpand all lines: packages/schema/src/agent.ts +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as Agent from "./agent" | | 1 | +export * as Agent from "./agent.js" | 2 | 2 |
| 3 | 3 | import { Schema } from "effect" | 4 | | -import { define, inventory } from "./event" | 5 | | -import { optional } from "./schema" | 6 | | -import { Model } from "./model" | 7 | | -import { Permission } from "./permission" | 8 | | -import { Provider } from "./provider" | 9 | | -import { PositiveInt, statics } from "./schema" | | 4 | +import { define, inventory } from "./event.js" | | 5 | +import { optional } from "./schema.js" | | 6 | +import { Model } from "./model.js" | | 7 | +import { Permission } from "./permission.js" | | 8 | +import { Provider } from "./provider.js" | | 9 | +import { PositiveInt, statics } from "./schema.js" | 10 | 10 |
| 11 | 11 | const Updated = define({ type: "agent.updated", schema: {} }) | 12 | 12 |
| |
Collapse file Copy file name to clipboard +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as Catalog from "./catalog" | | 1 | +export * as Catalog from "./catalog.js" | 2 | 2 |
| 3 | | -import { define, inventory } from "./event" | | 3 | +import { define, inventory } from "./event.js" | 4 | 4 |
| 5 | 5 | const Updated = define({ type: "catalog.updated", schema: {} }) | 6 | 6 | export const Event = { Updated, Definitions: inventory(Updated) } |
Collapse file Copy file name to clipboardExpand all lines: packages/schema/src/command.ts +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as Command from "./command" | | 1 | +export * as Command from "./command.js" | 2 | 2 |
| 3 | 3 | import { Schema } from "effect" | 4 | | -import { optional } from "./schema" | 5 | | -import { Model } from "./model" | | 4 | +import { optional } from "./schema.js" | | 5 | +import { Model } from "./model.js" | 6 | 6 |
| 7 | 7 | export interface Info extends Schema.Schema.Type<typeof Info> {} | 8 | 8 | export const Info = Schema.Struct({ | |
Collapse file Copy file name to clipboardExpand all lines: packages/schema/src/connection.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as Connection from "./connection" | | 1 | +export * as Connection from "./connection.js" | 2 | 2 |
| 3 | 3 | import { Schema } from "effect" | 4 | | -import { Credential } from "./credential" | | 4 | +import { Credential } from "./credential.js" | 5 | 5 |
| 6 | 6 | export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {} | 7 | 7 | export const CredentialInfo = Schema.Struct({ | |
Collapse file Copy file name to clipboardExpand all lines: packages/schema/src/credential.ts +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as Credential from "./credential" | | 1 | +export * as Credential from "./credential.js" | 2 | 2 |
| 3 | 3 | import { Schema } from "effect" | 4 | | -import { optional } from "./schema" | 5 | | -import { IntegrationMethodID } from "./integration-id" | 6 | | -import { ascending } from "./identifier" | 7 | | -import { NonNegativeInt, statics } from "./schema" | | 4 | +import { optional } from "./schema.js" | | 5 | +import { IntegrationMethodID } from "./integration-id.js" | | 6 | +import { ascending } from "./identifier.js" | | 7 | +import { NonNegativeInt, statics } from "./schema.js" | 8 | 8 |
| 9 | 9 | export const ID = Schema.String.pipe( | 10 | 10 | Schema.brand("Credential.ID"), | |
Collapse file Copy file name to clipboardExpand all lines: packages/schema/src/durable-event-manifest.ts +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -export * as DurableEventManifest from "./durable-event-manifest" | | 1 | +export * as DurableEventManifest from "./durable-event-manifest.js" | 2 | 2 |
| 3 | | -import { Event } from "./event" | 4 | | -import { SessionEvent } from "./session-event" | 5 | | -import { SessionV1 } from "./session-v1" | | 3 | +import { Event } from "./event.js" | | 4 | +import { SessionEvent } from "./session-event.js" | | 5 | +import { SessionV1 } from "./session-v1.js" | 6 | 6 |
| 7 | 7 | export const SessionDurable = { | 8 | 8 | definitions: Event.durable(SessionEvent.DurableDefinitions), | |
|