Skip to content

Commit

Permalink
Add new files and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MyraxByte committed Jan 20, 2024
1 parent 07b42d9 commit 0430625
Show file tree
Hide file tree
Showing 11 changed files with 3,554 additions and 65 deletions.
Binary file added .github/assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
if: ${{ github.repository_owner == 'myrax_byte' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm run build
- name: Create Release Pull Request
uses: changesets/action@v1
with:
version: npx changeset version
publish: npx changeset publish
commit: "[ci] release"
title: "[ci] release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Vite Tunnel

![Screenshot](./.github/assets/screenshot.png)

Vite Tunnel is an Vite plugin that allows you to expose your local Vite server to the internet using [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps).

## Installation

To install Vite Tunnel, run the following command with your preferred package manager:

```sh
npm install -D @vite-libs/tunnel
```

## Usage

```ts
import { defineConfig } from "vite";

import ViteTunnelPlugin from "@vite-libs/tunnel";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [ViteTunnelPlugin()],
});
```

Upon first starting a tunnel, you will be prompted to accept the terms of the Cloudflare License, Terms and Privacy Policy on the command line. Once you accept these terms, a tunnel will be initiated and a public URL for your local Vite server will be displayed inside the toolbar.

## Configuration

Vite Tunnel accepts the following options:

```ts
ViteTunnelPlugin({
// The local server port to expose. Defaults to 5521.
port: 5521,
// The local server hostname to expose. Defaults to localhost.
host: "localhost",
// The local server protocol to use. Defaults to http.
protocol: "http",
// Whether to verify the local server TLS certificate. Defaults to false.
verifyTLS: false,
// Whether to accept the Cloudflare terms of service. Defaults to false.
acceptCloudflareNotice: false,
});
```
21 changes: 4 additions & 17 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BuildConfig } from "unbuild"

export default [{
entries: ["src/plugin/index.ts"],
entries: ["src/plugin.ts"],
outDir: "dist",
clean: true,
declaration: true,
Expand All @@ -13,19 +15,4 @@ export default [{
},
inlineDependencies: true,
},
}, {
entries: ["src/client/index.ts"],
outDir: "dist",
clean: true,
declaration: true,
externals: [
'@vite-libs/devtools'
],
rollup: {
emitCJS: true,
esbuild: {
minify: true
},
inlineDependencies: true,
},
}]
}] as BuildConfig[]
Loading

0 comments on commit 0430625

Please sign in to comment.