Skip to content

Commit

Permalink
chore: some config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Jan 2, 2025
1 parent 9b99198 commit ab629e6
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ antfu
biomejs
booleanish
bumpp
bunfig
bunx
changelogen
changelogithub
Expand Down
11 changes: 7 additions & 4 deletions bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config } from '../src/config'

const cli = new CAC('my-cli')

interface ReverseProxyOption {
interface CliOption {
from: string
verbose: boolean
}
Expand All @@ -14,9 +14,12 @@ cli
.option('--from <from>', 'The URL to proxy from')
.option('--verbose', 'Enable verbose logging')
.example('reverse-proxy start --from localhost:5173 --to my-project.localhost')
.action(async (options?: ReverseProxyOption) => {
if (!options?.from || !options.to) {
return startProxies(config)
.action(async (options?: CliOption) => {
if (!options?.from) {
console.error('Missing --from option')
}
else {
console.log('Options:', options)
}
})

Expand Down
Empty file added binary.config.ts
Empty file.
3 changes: 3 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@types/bun": "^1.1.14",
"bumpp": "^9.9.2",
"bun-plugin-dtsx": "^0.21.9",
"bunfig": "^0.4.0",
"changelogen": "^0.5.7",
"lint-staged": "^15.3.0",
"simple-git-hooks": "^2.11.1",
Expand Down Expand Up @@ -653,6 +654,8 @@

"bundle-name": ["[email protected]", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],

"bunfig": ["[email protected]", "", {}, "sha512-VhKmKBWaG7i7Jha3/nL0rQJs9QPNg1WKnfmt1a7NlqI8AOVLusELOUas8ROXt2QXjwByiVwGm5onuATImSApbA=="],

"c12": ["[email protected]", "", { "dependencies": { "chokidar": "^4.0.1", "confbox": "^0.1.7", "defu": "^6.1.4", "dotenv": "^16.4.5", "giget": "^1.2.3", "jiti": "^2.3.0", "mlly": "^1.7.1", "ohash": "^1.1.4", "pathe": "^1.1.2", "perfect-debounce": "^1.0.0", "pkg-types": "^1.2.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "^0.3.5" }, "optionalPeers": ["magicast"] }, "sha512-Z4JgsKXHG37C6PYUtIxCfLJZvo6FyhHJoClwwb9ftUkLpPSkuYqn6Tr+vnaN8hymm0kIbcg6Ey3kv/Q71k5w/A=="],

"cac": ["[email protected]", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@types/bun": "^1.1.14",
"bumpp": "^9.9.2",
"bun-plugin-dtsx": "^0.21.9",
"bunfig": "^0.4.0",
"changelogen": "^0.5.7",
"lint-staged": "^15.3.0",
"simple-git-hooks": "^2.11.1",
Expand Down
13 changes: 13 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { BinaryConfig } from './types'
import { loadConfig } from 'bunfig'

export const defaultConfig: BinaryConfig = {
from: 'localhost:5173',
verbose: true,
}

// eslint-disable-next-line antfu/no-top-level-await
export const config: BinaryConfig = await loadConfig({
name: 'binary',
defaultConfig,
})
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const one = 1
export const two = 'two'
export * from './config'
export * from './types'
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface BinaryConfig {
from: string
verbose: boolean
}

0 comments on commit ab629e6

Please sign in to comment.