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 — ignore: run prettier · mmacia/opencode@51bf193

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • opencode.json
  • packages
    • function
      • sst-env.d.ts
    • opencode
      • config.schema.json
      • src
        • app
          • app.ts
        • cli/cmd
          • auth.ts
          • models.ts
          • scrap.ts
        • format
          • index.ts
        • tool
          • edit.ts
        • util
          • lazy.ts
          • log.ts
      • sst-env.d.ts
      • test/tool
        • edit.test.ts
    • tui
      • AGENTS.md
      • internal/theme/themes
        • ayu.json
        • catppuccin.json
        • cobalt2.json
        • dracula.json
        • everforest.json
        • github.json
        • material.json
        • monokai.json
        • opencode.json
        • palenight.json
        • rosepine.json
        • solarized.json
        • synthwave84.json
        • tokyonight.json
        • zenburn.json
      • pkg/client/gen
        • openapi.json
    • web
      • astro.config.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎opencode.json‎

Copy file name to clipboardExpand all lines: opencode.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"experimental": {
44
"hook": {
55
"file_edited": {
6-
".json": []
6+
".json": [
7+
{
8+
"command": ["bun", "run", "prettier", "$FILE"]
9+
}
10+
]
711
},
812
"session_completed": [
913
{
Collapse file

‎packages/function/sst-env.d.ts‎

Copy file name to clipboardExpand all lines: packages/function/sst-env.d.ts
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
import "sst"
77
declare module "sst" {
88
export interface Resource {
9-
"Web": {
10-
"type": "sst.cloudflare.Astro"
11-
"url": string
9+
Web: {
10+
type: "sst.cloudflare.Astro"
11+
url: string
1212
}
1313
}
1414
}
15-
// cloudflare
16-
import * as cloudflare from "@cloudflare/workers-types";
15+
// cloudflare
16+
import * as cloudflare from "@cloudflare/workers-types"
1717
declare module "sst" {
1818
export interface Resource {
19-
"Api": cloudflare.Service
20-
"Bucket": cloudflare.R2Bucket
19+
Api: cloudflare.Service
20+
Bucket: cloudflare.R2Bucket
2121
}
2222
}
2323

2424
import "sst"
25-
export {}
25+
export {}
Collapse file

‎packages/opencode/config.schema.json‎

Copy file name to clipboardExpand all lines: packages/opencode/config.schema.json
+8-26Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@
202202
"type": "number"
203203
}
204204
},
205-
"required": [
206-
"input",
207-
"output"
208-
],
205+
"required": ["input", "output"],
209206
"additionalProperties": false
210207
},
211208
"limit": {
@@ -218,10 +215,7 @@
218215
"type": "number"
219216
}
220217
},
221-
"required": [
222-
"context",
223-
"output"
224-
],
218+
"required": ["context", "output"],
225219
"additionalProperties": false
226220
},
227221
"id": {
@@ -240,9 +234,7 @@
240234
"additionalProperties": {}
241235
}
242236
},
243-
"required": [
244-
"models"
245-
],
237+
"required": ["models"],
246238
"additionalProperties": false
247239
},
248240
"description": "Custom provider configurations and model overrides"
@@ -274,10 +266,7 @@
274266
"description": "Environment variables to set when running the MCP server"
275267
}
276268
},
277-
"required": [
278-
"type",
279-
"command"
280-
],
269+
"required": ["type", "command"],
281270
"additionalProperties": false
282271
},
283272
{
@@ -293,10 +282,7 @@
293282
"description": "URL of the remote MCP server"
294283
}
295284
},
296-
"required": [
297-
"type",
298-
"url"
299-
],
285+
"required": ["type", "url"],
300286
"additionalProperties": false
301287
}
302288
]
@@ -329,9 +315,7 @@
329315
}
330316
}
331317
},
332-
"required": [
333-
"command"
334-
],
318+
"required": ["command"],
335319
"additionalProperties": false
336320
}
337321
}
@@ -354,9 +338,7 @@
354338
}
355339
}
356340
},
357-
"required": [
358-
"command"
359-
],
341+
"required": ["command"],
360342
"additionalProperties": false
361343
}
362344
}
@@ -369,4 +351,4 @@
369351
},
370352
"additionalProperties": false,
371353
"$schema": "http://json-schema.org/draft-07/schema#"
372-
}
354+
}
Collapse file

‎packages/opencode/src/app/app.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/app/app.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,3 @@ export namespace App {
142142
.replace(/[^A-Za-z0-9_]/g, "-")
143143
}
144144
}
145-
Collapse file

‎packages/opencode/src/cli/cmd/auth.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/auth.ts
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const AuthListCommand = cmd({
3131
UI.empty()
3232
const authPath = path.join(Global.Path.data, "auth.json")
3333
const homedir = os.homedir()
34-
const displayPath = authPath.startsWith(homedir)
34+
const displayPath = authPath.startsWith(homedir)
3535
? authPath.replace(homedir, "~")
3636
: authPath
3737
prompts.intro(`Credentials ${UI.Style.TEXT_DIM}${displayPath}`)
@@ -46,14 +46,14 @@ export const AuthListCommand = cmd({
4646
prompts.outro(`${results.length} credentials`)
4747

4848
// Environment variables section
49-
const activeEnvVars: Array<{ provider: string, envVar: string }> = []
50-
49+
const activeEnvVars: Array<{ provider: string; envVar: string }> = []
50+
5151
for (const [providerID, provider] of Object.entries(database)) {
5252
for (const envVar of provider.env) {
5353
if (process.env[envVar]) {
54-
activeEnvVars.push({
55-
provider: provider.name || providerID,
56-
envVar
54+
activeEnvVars.push({
55+
provider: provider.name || providerID,
56+
envVar,
5757
})
5858
}
5959
}
@@ -62,11 +62,11 @@ export const AuthListCommand = cmd({
6262
if (activeEnvVars.length > 0) {
6363
UI.empty()
6464
prompts.intro("Environment")
65-
65+
6666
for (const { provider, envVar } of activeEnvVars) {
6767
prompts.log.info(`${provider} ${UI.Style.TEXT_DIM}${envVar}`)
6868
}
69-
69+
7070
prompts.outro(`${activeEnvVars.length} environment variables`)
7171
}
7272
},
Collapse file

‎packages/opencode/src/cli/cmd/models.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/models.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export const ModelsCommand = cmd({
88
handler: async () => {
99
await App.provide({ cwd: process.cwd() }, async () => {
1010
const providers = await Provider.list()
11-
11+
1212
for (const [providerID, provider] of Object.entries(providers)) {
1313
for (const modelID of Object.keys(provider.info.models)) {
1414
console.log(`${providerID}/${modelID}`)
1515
}
1616
}
1717
})
1818
},
19-
})
19+
})
Collapse file

‎packages/opencode/src/cli/cmd/scrap.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/scrap.ts
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ export const ScrapCommand = cmd({
77
builder: (yargs) =>
88
yargs.positional("file", { type: "string", demandOption: true }),
99
async handler(args) {
10-
await App.provide(
11-
{ cwd: process.cwd() },
12-
async () => {
13-
await LSP.touchFile(args.file, true)
14-
console.log(await LSP.diagnostics())
15-
},
16-
)
10+
await App.provide({ cwd: process.cwd() }, async () => {
11+
await LSP.touchFile(args.file, true)
12+
console.log(await LSP.diagnostics())
13+
})
1714
},
1815
})
Collapse file

‎packages/opencode/src/format/index.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/format/index.ts
+55-55Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { App } from '../app/app'
2-
import { BunProc } from '../bun'
3-
import { Config } from '../config/config'
4-
import { Log } from '../util/log'
5-
import path from 'path'
1+
import { App } from "../app/app"
2+
import { BunProc } from "../bun"
3+
import { Config } from "../config/config"
4+
import { Log } from "../util/log"
5+
import path from "path"
66

77
export namespace Format {
8-
const log = Log.create({ service: 'format' })
8+
const log = Log.create({ service: "format" })
99

10-
const state = App.state('format', async () => {
10+
const state = App.state("format", async () => {
1111
const hooks: Record<string, Hook[]> = {}
1212
for (const item of FORMATTERS) {
1313
if (await item.enabled()) {
@@ -42,22 +42,22 @@ export namespace Format {
4242
})
4343

4444
export async function run(file: string) {
45-
log.info('formatting', { file })
45+
log.info("formatting", { file })
4646
const { hooks } = await state()
4747
const ext = path.extname(file)
4848
const match = hooks[ext]
4949
if (!match) return
5050

5151
for (const item of match) {
52-
log.info('running', { command: item.command })
52+
log.info("running", { command: item.command })
5353
const proc = Bun.spawn({
54-
cmd: item.command.map((x) => x.replace('$FILE', file)),
54+
cmd: item.command.map((x) => x.replace("$FILE", file)),
5555
cwd: App.info().path.cwd,
5656
env: item.environment,
5757
})
5858
const exit = await proc.exited
5959
if (exit !== 0)
60-
log.error('failed', {
60+
log.error("failed", {
6161
command: item.command,
6262
...item.environment,
6363
})
@@ -79,58 +79,58 @@ export namespace Format {
7979

8080
const FORMATTERS: Native[] = [
8181
{
82-
name: 'prettier',
83-
extensions: [
84-
'.js',
85-
'.jsx',
86-
'.mjs',
87-
'.cjs',
88-
'.ts',
89-
'.tsx',
90-
'.mts',
91-
'.cts',
92-
'.html',
93-
'.htm',
94-
'.css',
95-
'.scss',
96-
'.sass',
97-
'.less',
98-
'.vue',
99-
'.svelte',
100-
'.json',
101-
'.jsonc',
102-
'.yaml',
103-
'.yml',
104-
'.toml',
105-
'.xml',
106-
'.md',
107-
'.mdx',
108-
'.php',
109-
'.rb',
110-
'.java',
111-
'.go',
112-
'.rs',
113-
'.swift',
114-
'.kt',
115-
'.kts',
116-
'.sol',
117-
'.graphql',
118-
'.gql',
119-
],
120-
command: [BunProc.which(), 'run', 'prettier', '--write', '$FILE'],
82+
name: "prettier",
83+
command: [BunProc.which(), "run", "prettier", "--write", "$FILE"],
12184
environment: {
122-
BUN_BE_BUN: '1',
85+
BUN_BE_BUN: "1",
12386
},
87+
extensions: [
88+
".js",
89+
".jsx",
90+
".mjs",
91+
".cjs",
92+
".ts",
93+
".tsx",
94+
".mts",
95+
".cts",
96+
".html",
97+
".htm",
98+
".css",
99+
".scss",
100+
".sass",
101+
".less",
102+
".vue",
103+
".svelte",
104+
".json",
105+
".jsonc",
106+
".yaml",
107+
".yml",
108+
".toml",
109+
".xml",
110+
".md",
111+
".mdx",
112+
".php",
113+
".rb",
114+
".java",
115+
".go",
116+
".rs",
117+
".swift",
118+
".kt",
119+
".kts",
120+
".sol",
121+
".graphql",
122+
".gql",
123+
],
124124
async enabled() {
125125
try {
126126
const proc = Bun.spawn({
127-
cmd: [BunProc.which(), 'run', 'prettier', '--version'],
127+
cmd: [BunProc.which(), "run", "prettier", "--version"],
128128
cwd: App.info().path.cwd,
129129
env: {
130-
BUN_BE_BUN: '1',
130+
BUN_BE_BUN: "1",
131131
},
132-
stdout: 'ignore',
133-
stderr: 'ignore',
132+
stdout: "ignore",
133+
stderr: "ignore",
134134
})
135135
const exit = await proc.exited
136136
return exit === 0
Collapse file

‎packages/opencode/src/tool/edit.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/tool/edit.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export const EditTool = Tool.define({
8080
)
8181
await file.write(contentNew)
8282
await Format.run(filepath)
83+
contentNew = await file.text()
8384
})()
8485

8586
const diff = trimDiff(
Collapse file

‎packages/opencode/src/util/lazy.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/util/lazy.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ export function lazy<T>(fn: () => T) {
88
return value as T
99
}
1010
}
11-

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.