GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(schema): publish package · jonBoone/opencode@5e47501

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bun.lock
  • packages
    • schema
      • package.json
      • script
        • build.ts
        • publish.ts
      • src
        • agent.ts
        • catalog.ts
        • command.ts
        • connection.ts
        • credential.ts
        • durable-event-manifest.ts
        • event-manifest.ts
        • event.ts
        • file-diff.ts
        • filesystem-watcher.ts
        • filesystem.ts
        • ide-event.ts
        • index.ts
        • installation-event.ts
        • integration.ts
        • legacy-event.ts
        • llm.ts
        • location.ts
        • lsp-event.ts
        • mcp-event.ts
        • mcp.ts
        • model.ts
        • models-dev.ts
        • permission-saved.ts
        • permission-v1.ts
        • permission.ts
        • plugin.ts
        • project-copy.ts
        • project-directories.ts
        • project-id.ts
        • project.ts
        • prompt-input.ts
        • prompt.ts
        • provider.ts
        • pty-ticket.ts
        • pty.ts
        • question-v1.ts
        • question.ts
        • reference.ts
        • revert.ts
        • server-event.ts
        • session-compaction-event.ts
        • session-delivery.ts
        • session-event.ts
        • session-id.ts
        • session-input.ts
        • session-message.ts
        • session-status-event.ts
        • session-todo.ts
        • session-v1.ts
        • session.ts
        • shell.ts
        • skill.ts
        • tui-event.ts
        • v1
          • legacy-event.ts
          • permission.ts
          • question.ts
          • session.ts
        • vcs-event.ts
        • workspace-event.ts
        • workspace-id.ts
        • workspace.ts
        • worktree-event.ts
      • test
        • compatibility.test.ts
        • contract-hygiene.test.ts
        • event-manifest.test.ts
        • event.test.ts
        • legacy-event.test.ts
        • v1-isolation.test.ts
      • tsconfig.build.json
      • tsconfig.json
    • script
      • package.json
  • script
    • publish.ts

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bun.lock‎

Copy file name to clipboardExpand all lines: bun.lock
+2Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎packages/schema/package.json‎

Copy file name to clipboard
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@opencode-ai/schema",
4-
"private": true,
4+
"version": "1.17.11",
55
"type": "module",
66
"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+
],
718
"exports": {
819
".": "./src/index.ts",
920
"./*": "./src/*.ts"
1021
},
1122
"scripts": {
23+
"build": "bun run script/build.ts",
1224
"typecheck": "tsgo --noEmit"
1325
},
1426
"dependencies": {
@@ -17,6 +29,7 @@
1729
"devDependencies": {
1830
"@tsconfig/bun": "catalog:",
1931
"@types/bun": "catalog:",
20-
"@typescript/native-preview": "catalog:"
32+
"@typescript/native-preview": "catalog:",
33+
"typescript": "catalog:"
2134
}
2235
}
Collapse file

‎packages/schema/script/build.ts‎

Copy file name to clipboard
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

‎packages/schema/script/publish.ts‎

Copy file name to clipboard
+45Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

‎packages/schema/src/agent.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/agent.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export * as Agent from "./agent"
1+
export * as Agent from "./agent.js"
22

33
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"
1010

1111
const Updated = define({ type: "agent.updated", schema: {} })
1212

Collapse file

‎packages/schema/src/catalog.ts‎

Copy file name to clipboard
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export * as Catalog from "./catalog"
1+
export * as Catalog from "./catalog.js"
22

3-
import { define, inventory } from "./event"
3+
import { define, inventory } from "./event.js"
44

55
const Updated = define({ type: "catalog.updated", schema: {} })
66
export const Event = { Updated, Definitions: inventory(Updated) }
Collapse file

‎packages/schema/src/command.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/command.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export * as Command from "./command"
1+
export * as Command from "./command.js"
22

33
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"
66

77
export interface Info extends Schema.Schema.Type<typeof Info> {}
88
export const Info = Schema.Struct({
Collapse file

‎packages/schema/src/connection.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/connection.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export * as Connection from "./connection"
1+
export * as Connection from "./connection.js"
22

33
import { Schema } from "effect"
4-
import { Credential } from "./credential"
4+
import { Credential } from "./credential.js"
55

66
export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {}
77
export const CredentialInfo = Schema.Struct({
Collapse file

‎packages/schema/src/credential.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/credential.ts
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
export * as Credential from "./credential"
1+
export * as Credential from "./credential.js"
22

33
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"
88

99
export const ID = Schema.String.pipe(
1010
Schema.brand("Credential.ID"),
Collapse file

‎packages/schema/src/durable-event-manifest.ts‎

Copy file name to clipboardExpand all lines: packages/schema/src/durable-event-manifest.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export * as DurableEventManifest from "./durable-event-manifest"
1+
export * as DurableEventManifest from "./durable-event-manifest.js"
22

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"
66

77
export const SessionDurable = {
88
definitions: Event.durable(SessionEvent.DurableDefinitions),

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.