unplugin-cloudflare-tunnel 0.0.0-alpha-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,41 @@
1
+ //#region src/virtual.d.ts
2
+ /**
3
+ * Type definitions for virtual:unplugin-cloudflare-tunnel
4
+ *
5
+ * This virtual module is provided by unplugin-cloudflare-tunnel
6
+ * and is only available during development mode.
7
+ */
8
+
9
+ declare module 'virtual:unplugin-cloudflare-tunnel' {
10
+ /**
11
+ * Get the current tunnel URL.
12
+ *
13
+ * Returns the active Cloudflare tunnel URL for the current development session.
14
+ * - In quick tunnel mode: Returns a random `https://xyz.trycloudflare.com` URL
15
+ * - In named tunnel mode: Returns your custom domain URL (e.g., `https://dev.example.com`)
16
+ *
17
+ * The URL is automatically updated if the local port changes or the tunnel is restarted.
18
+ *
19
+ * @returns The current tunnel URL as a string
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { getTunnelUrl } from 'virtual:unplugin-cloudflare-tunnel';
24
+ *
25
+ * // Get the tunnel URL
26
+ * const tunnelUrl = getTunnelUrl();
27
+ * console.log('Public tunnel URL:', tunnelUrl);
28
+ *
29
+ * // Use in your app
30
+ * const shareButton = document.getElementById('share');
31
+ * shareButton.onclick = () => {
32
+ * navigator.clipboard.writeText(getTunnelUrl());
33
+ * alert('Tunnel URL copied to clipboard!');
34
+ * };
35
+ * ```
36
+ *
37
+ * @note This function is only available during development mode.
38
+ * In production builds, this virtual module will not be available.
39
+ */
40
+ export function getTunnelUrl(): string;
41
+ }
package/dist/vite.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { r as CloudflareTunnel } from "./index-BjNI6nQt.js";
2
+
3
+ //#region src/vite.d.ts
4
+
5
+ /**
6
+ * Vite plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // vite.config.ts
11
+ * import CloudflareTunnel from 'unplugin-cloudflare-tunnel/vite'
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [CloudflareTunnel()],
15
+ * })
16
+ * ```
17
+ */
18
+ declare const vite: typeof CloudflareTunnel.vite;
19
+ //#endregion
20
+ export { vite as default, vite as "module.exports" };
package/dist/vite.js ADDED
@@ -0,0 +1,21 @@
1
+ import { t as CloudflareTunnel } from "./src-BC4MyCER.js";
2
+
3
+ //#region src/vite.ts
4
+ /**
5
+ * Vite plugin
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // vite.config.ts
10
+ * import CloudflareTunnel from 'unplugin-cloudflare-tunnel/vite'
11
+ *
12
+ * export default defineConfig({
13
+ * plugins: [CloudflareTunnel()],
14
+ * })
15
+ * ```
16
+ */
17
+ const vite = CloudflareTunnel.vite;
18
+ var vite_default = vite;
19
+
20
+ //#endregion
21
+ export { vite_default as default, vite as "module.exports" };
@@ -0,0 +1,20 @@
1
+ import { r as CloudflareTunnel } from "./index-BjNI6nQt.js";
2
+
3
+ //#region src/webpack.d.ts
4
+
5
+ /**
6
+ * Webpack plugin
7
+ *
8
+ * @example
9
+ * ```js
10
+ * // webpack.config.js
11
+ * import CloudflareTunnel from 'unplugin-cloudflare-tunnel/webpack'
12
+ *
13
+ * export default {
14
+ * plugins: [CloudflareTunnel()],
15
+ * }
16
+ * ```
17
+ */
18
+ declare const webpack: typeof CloudflareTunnel.webpack;
19
+ //#endregion
20
+ export { webpack as default, webpack as "module.exports" };
@@ -0,0 +1,21 @@
1
+ import { t as CloudflareTunnel } from "./src-BC4MyCER.js";
2
+
3
+ //#region src/webpack.ts
4
+ /**
5
+ * Webpack plugin
6
+ *
7
+ * @example
8
+ * ```js
9
+ * // webpack.config.js
10
+ * import CloudflareTunnel from 'unplugin-cloudflare-tunnel/webpack'
11
+ *
12
+ * export default {
13
+ * plugins: [CloudflareTunnel()],
14
+ * }
15
+ * ```
16
+ */
17
+ const webpack = CloudflareTunnel.webpack;
18
+ var webpack_default = webpack;
19
+
20
+ //#endregion
21
+ export { webpack_default as default, webpack as "module.exports" };
package/package.json ADDED
@@ -0,0 +1,133 @@
1
+ {
2
+ "name": "unplugin-cloudflare-tunnel",
3
+ "version": "0.0.0-alpha-1",
4
+ "packageManager": "bun@1.3.1",
5
+ "description": "A plugin that automatically creates and manages Cloudflare tunnels for local development",
6
+ "type": "module",
7
+ "imports": {
8
+ "#*": "./src/*",
9
+ "#package.json": "./package.json"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "package.json"
14
+ ],
15
+ "main": "./dist/index.js",
16
+ "module": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": "./dist/index.js",
20
+ "./astro": "./dist/astro.js",
21
+ "./vite": "./dist/vite.js",
22
+ "./webpack": "./dist/webpack.js",
23
+ "./rspack": "./dist/rspack.js",
24
+ "./rollup": "./dist/rollup.js",
25
+ "./rolldown": "./dist/rolldown.js",
26
+ "./esbuild": "./dist/esbuild.js",
27
+ "./farm": "./dist/farm.js",
28
+ "./api": "./dist/api.js",
29
+ "./*": "./*",
30
+ "./virtual": "./dist/virtual.d.ts"
31
+ },
32
+ "typesVersions": {
33
+ "*": {
34
+ "*": [
35
+ "./dist/*",
36
+ "./*"
37
+ ]
38
+ }
39
+ },
40
+ "scripts": {
41
+ "build": "tsdown --config='tsdown.config.ts'",
42
+ "check": "biome check . --fix --unsafe",
43
+ "check:types": "tsc --project tsconfig.json --noEmit",
44
+ "publint": "bun x publint@latest run --pack bun --strict",
45
+ "attw": "bun x @arethetypeswrong/cli@latest --pack . --ignore-rules='false-cjs' --ignore-rules='cjs-resolves-to-esm'",
46
+ "changeset:version": "changeset version && biome format . --write",
47
+ "changeset:publish": "bun ./scripts/publish.ts --registry='https://registry.npmjs.org'",
48
+ "*": "bun run build && bun check && bun check:types",
49
+ "prepublishOnly": "bun run build"
50
+ },
51
+ "dependencies": {
52
+ "cloudflared": "^0.7.1",
53
+ "unplugin": "^2.3.10",
54
+ "unplugin-utils": "^0.3.1",
55
+ "zod": "^4.1.12"
56
+ },
57
+ "devDependencies": {
58
+ "@arethetypeswrong/core": "^0.18.2",
59
+ "@biomejs/biome": "^2.3.2",
60
+ "@changesets/changelog-github": "^0.5.1",
61
+ "@changesets/cli": "^2.29.7",
62
+ "@rspack/core": "^1.5.7",
63
+ "@sxzz/test-utils": "^0.5.12",
64
+ "@total-typescript/ts-reset": "^0.6.1",
65
+ "@types/bun": "^1.3.1",
66
+ "@types/node": "^24.9.1",
67
+ "execa": "^9.6.0",
68
+ "publint": "^0.3.15",
69
+ "rollup": "^4.52.3",
70
+ "tsdown": "^0.15.10",
71
+ "tsx": "^4.20.6",
72
+ "typescript": "^5.9.3",
73
+ "unplugin-unused": "^0.5.4",
74
+ "vite": "^7.1.12",
75
+ "vitest": "^4.0.3",
76
+ "webpack-dev-server": "^5.2.2"
77
+ },
78
+ "peerDependencies": {
79
+ "vite": ">=3",
80
+ "esbuild": ">=0.2",
81
+ "rollup": "^3",
82
+ "@farmfe/core": ">=1",
83
+ "webpack": "^5",
84
+ "@rspack/core": ">=1",
85
+ "astro": ">=5"
86
+ },
87
+ "peerDependenciesMeta": {
88
+ "@farmfe/core": {
89
+ "optional": true
90
+ },
91
+ "esbuild": {
92
+ "optional": true
93
+ },
94
+ "rollup": {
95
+ "optional": true
96
+ },
97
+ "rolldown": {
98
+ "optional": true
99
+ },
100
+ "@rspack/core": {
101
+ "optional": true
102
+ },
103
+ "vite": {
104
+ "optional": true
105
+ },
106
+ "webpack": {
107
+ "optional": true
108
+ },
109
+ "astro": {
110
+ "optional": true
111
+ }
112
+ },
113
+ "engines": {
114
+ "node": ">=20.19.0"
115
+ },
116
+ "keywords": [
117
+ "unplugin",
118
+ "vite",
119
+ "webpack",
120
+ "rspack",
121
+ "rollup",
122
+ "rolldown",
123
+ "esbuild",
124
+ "farm",
125
+ "astro"
126
+ ],
127
+ "license": "MIT",
128
+ "repository": "o-az/unplugin-cloudflare-tunnel",
129
+ "author": "Omar A <gh@omar.mov>",
130
+ "publishConfig": {
131
+ "access": "public"
132
+ }
133
+ }