Skip to content

Commit

Permalink
chore: minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Dec 18, 2024
1 parent 1be13ed commit 735eba6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .vscode/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ destructurable
dtsx
entrypoints
heroicons
iconify
lockb
openweb
outdir
Expand All @@ -25,12 +26,15 @@ Postcardware
prefetch
preinstall
quickfix
shikijs
socio
Solana
Spatie
stacksjs
tlsx
twoslash
typecheck
unocss
unplugin
unref
upath
Expand Down
6 changes: 2 additions & 4 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@stacksjs/eslint-config": "^3.12.0-beta.4",
"@stacksjs/rpx": "^0.8.0",
"@stacksjs/rpx": "^0.9.0",
"@types/bun": "^1.1.14",
"bumpp": "^9.9.1",
"bun-plugin-dtsx": "^0.21.9",
Expand Down Expand Up @@ -460,9 +460,7 @@

"@stacksjs/eslint-plugin": ["@stacksjs/eslint-plugin@0.1.3", "", {}, "sha512-35S2kasi4D7Xh7fil+4IIX7Oaop6W1aiGlsm1IBYqahRq/P+1we5Pb5Fa1WPz0kyMiEtFg1130woIywzdhELSg=="],

"@stacksjs/rpx": ["@stacksjs/rpx@0.8.0", "", { "dependencies": { "@stacksjs/tlsx": "^0.8.5" }, "bin": { "rpx": "dist/bin/cli.js", "reverse-proxy": "dist/bin/cli.js" } }, "sha512-g774RxyR3G1HNt30ngwGjdhLByiTI6vO4mzckW9tZdSbgdR+i04ZxNRySr4QxKjBcFM4WkQtduGW9S5HnVtFwg=="],

"@stacksjs/tlsx": ["@stacksjs/tlsx@0.8.5", "", { "bin": { "tlsx": "dist/bin/cli.js" } }, "sha512-1CbVQEy/I8e8bzMvQYX4RCAX4CQLOZxPSVQaH5G8FnjRMRxXToJxC8xuzZ4cBz83ZtnNVVbi0Sgz+cWXJRrTJA=="],
"@stacksjs/rpx": ["@stacksjs/rpx@0.9.0", "", { "bin": { "rpx": "dist/bin/cli.js", "reverse-proxy": "dist/bin/cli.js" } }, "sha512-gcSZZ62mj2ASwEqwWpLwul882KGSd8pYNZu1TQo0yvPwv/SnhhFYNbL+Xjc7cxQVJjtoGuzveQfOGJBK5+y4sw=="],

"@stylistic/eslint-plugin": ["@stylistic/eslint-plugin@2.12.1", "", { "dependencies": { "@typescript-eslint/utils": "^8.13.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "estraverse": "^5.3.0", "picomatch": "^4.0.2" }, "peerDependencies": { "eslint": ">=8.40.0" } }, "sha512-fubZKIHSPuo07FgRTn6S4Nl0uXPRPYVNpyZzIDGfp7Fny6JjNus6kReLD7NI380JXi4HtUTSOZ34LBuNPO1XLQ=="],

Expand Down
4 changes: 0 additions & 4 deletions docs/.vitepress/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,5 @@ export default defineConfig({
// 'vue',
'body-scroll-lock',
],

include: [
'nprogress',
],
},
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"devDependencies": {
"@stacksjs/eslint-config": "^3.12.0-beta.4",
"@stacksjs/rpx": "^0.8.0",
"@stacksjs/rpx": "^0.9.0",
"@types/bun": "^1.1.14",
"bumpp": "^9.9.1",
"bun-plugin-dtsx": "^0.21.9",
Expand Down
13 changes: 6 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import process from 'node:process'
import { promisify } from 'node:util'
// @ts-expect-error dtsx issues
import { checkExistingCertificates, checkHosts, cleanup, startProxies } from '@stacksjs/rpx'
import { bold, cyan, dim, green } from 'picocolors'
import colors from 'picocolors'
import { buildConfig } from './utils'

const execAsync = promisify(exec)
Expand Down Expand Up @@ -202,8 +202,7 @@ export function VitePluginLocal(options: VitePluginLocalOptions): Plugin {
}
})

const colorUrl = (url: string) =>
cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`))
const colorUrl = (url: string) => colors.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors.bold(port)}/`))

// Store the original printUrls function
const originalPrintUrls = server.printUrls
Expand All @@ -219,18 +218,18 @@ export function VitePluginLocal(options: VitePluginLocalOptions): Plugin {
}
else {
// If no other plugin has modified printUrls, print the default local URL
console.log(` ${green('➜')} ${bold('Local')}: ${colorUrl(server.resolvedUrls.local[0])}`)
console.log(` ${green('➜')} ${bold('Network')}: ${dim('use --host to expose')}`)
console.log(` ${colors.green('➜')} ${colors.bold('Local')}: ${colorUrl(server.resolvedUrls.local[0])}`)
console.log(` ${colors.green('➜')} ${colors.bold('Network')}: ${colors.dim('use --host to expose')}`)
}

// Add our custom proxy URL information
if (proxyUrl) {
const protocol = options.https ? 'https' : 'http'
const proxiedUrl = `${protocol}://${proxyUrl}/`
console.log(` ${green('➜')} ${bold('Proxied URL')}: ${colorUrl(proxiedUrl)}`)
console.log(` ${colors.green('➜')} ${colors.bold('Proxied URL')}: ${colorUrl(proxiedUrl)}`)

if (options.https) {
console.log(` ${green('➜')} ${bold('SSL')}: ${dim('TLS 1.2/1.3, HTTP/2')}`)
console.log(` ${colors.green('➜')} ${colors.bold('SSL')}: ${colors.dim('TLS 1.2/1.3, HTTP/2')}`)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-expect-error dtsx issues
import type { TlsConfig } from '@stacksjs/rpx'

export interface VitePluginLocalOptions {
Expand Down

0 comments on commit 735eba6

Please sign in to comment.