Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Mar 5, 2024
1 parent 6bb85ac commit 602c9e1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
<!-- [![Codecov][codecov-src]][codecov-href] -->

# Reverse Proxy
# A Better Developer Experience

A modern reverse proxy. Pretty dev URLs for your local projects, with simplicity and flexibility.
> A reverse proxy for local development with SSL support, custom domains, and more.
## ☘️ Features

Expand All @@ -34,7 +34,7 @@ import { startProxy } from 'bun-reverse-proxy'

startProxy({
from: 'localhost:3000',
to: 'my-project.localhost'
to: 'my-project.localhost' // or try 'my-project.test'
})
```

Expand Down
25 changes: 18 additions & 7 deletions build.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
await Bun.build({
entrypoints: [
'src/index.ts',
],
import { $ } from 'bun'
import dts from 'bun-plugin-dts-auto'

await Bun.build({
entrypoints: ['./src/index.ts', './bin/cli.ts'],
outdir: './dist',
format: 'esm',
target: 'bun',

// plugins: [
// dts(),
// ],
plugins: [
dts({
cwd: import.meta.dir,
}),
],
})

await $`cp ./dist/src/index.js ./dist/index.js`
await $`rm -rf ./dist/src`
await $`cp ./dist/bin/cli.js ./dist/cli.js`
await $`rm -rf ./dist/bin`
await $`cp ./bin/cli.d.ts ./dist/cli.d.ts` // while bun-plugin-dts-auto doesn't support bin files well
await $`rm ./bin/cli.d.ts`
9 changes: 9 additions & 0 deletions compile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { log, runCommand } from '@stacksjs/cli'

// compiles the buddy binary
const result = await runCommand('bun build ./bin/cli.ts --compile --minify --sourcemap --outfile dist/reverse-proxy', {
cwd: import.meta.dir,
})

if (result.isErr())
log.error(result.error)
3 changes: 3 additions & 0 deletions reverse-proxy.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
'localhost:3000': 'stacks.localhost'
}

0 comments on commit 602c9e1

Please # to comment.