unplugin-cloudflare-tunnel 0.1.0 → 0.1.2
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.
- package/{.github/README.md → README.md} +125 -32
- package/dist/astro.d.mts +1 -1
- package/dist/astro.mjs +2 -1
- package/dist/esbuild.d.mts +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/farm.d.mts +1 -1
- package/dist/farm.mjs +1 -1
- package/dist/index.d.mts +2 -172
- package/dist/index.mjs +1 -1088
- package/dist/options-DI3sWmXl.d.mts +67 -0
- package/dist/rolldown.d.mts +2677 -626
- package/dist/rolldown.mjs +1 -1
- package/dist/rollup.d.mts +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.d.mts +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/src-D0eR3kCb.mjs +1949 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +23 -21
- package/dist/api.d.mts +0 -53
- package/dist/api.mjs +0 -58
- package/dist/schemas-Cpk3vGGi.mjs +0 -792
- package/dist/schemas-DKJtFAG_.d.mts +0 -702
package/dist/vite.d.mts
CHANGED
package/dist/vite.mjs
CHANGED
package/dist/webpack.d.mts
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-cloudflare-tunnel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A plugin that automatically creates and manages Cloudflare tunnels for local development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"imports": {
|
|
@@ -11,22 +11,20 @@
|
|
|
11
11
|
"dist",
|
|
12
12
|
"LICENSE",
|
|
13
13
|
"package.json",
|
|
14
|
-
"
|
|
14
|
+
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"types": "./dist/index.d.mts",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": "./dist/index.mjs",
|
|
19
|
-
"./api": "./dist/api.mjs",
|
|
20
19
|
"./astro": "./dist/astro.mjs",
|
|
21
20
|
"./esbuild": "./dist/esbuild.mjs",
|
|
22
21
|
"./farm": "./dist/farm.mjs",
|
|
23
22
|
"./rolldown": "./dist/rolldown.mjs",
|
|
24
23
|
"./rollup": "./dist/rollup.mjs",
|
|
25
24
|
"./rspack": "./dist/rspack.mjs",
|
|
26
|
-
"./schemas-Cpk3vGGi": "./dist/schemas-Cpk3vGGi.mjs",
|
|
27
25
|
"./vite": "./dist/vite.mjs",
|
|
28
26
|
"./webpack": "./dist/webpack.mjs",
|
|
29
|
-
"
|
|
27
|
+
"./package.json": "./package.json"
|
|
30
28
|
},
|
|
31
29
|
"typesVersions": {
|
|
32
30
|
"*": {
|
|
@@ -38,14 +36,19 @@
|
|
|
38
36
|
},
|
|
39
37
|
"scripts": {
|
|
40
38
|
"build": "tsdown",
|
|
41
|
-
"
|
|
39
|
+
"format": "oxfmt --config='oxfmt.config.ts' --write",
|
|
40
|
+
"lint": "oxlint --config='oxlint.config.ts' --type-aware --type-check --fix-dangerously",
|
|
41
|
+
"check": "bun format && bun lint",
|
|
42
42
|
"check:types": "bun tsgo --project tsconfig.json --noEmit",
|
|
43
|
-
"test": "vitest --run",
|
|
44
|
-
"changeset:version": "changeset version &&
|
|
45
|
-
"changeset:publish": "
|
|
43
|
+
"test": "NODE_NO_WARNINGS=1 vitest --run",
|
|
44
|
+
"changeset:version": "changeset version && bun format",
|
|
45
|
+
"changeset:publish": "changeset publish",
|
|
46
|
+
"publish:manual": "bun ./scripts/publish.ts --registry='https://registry.npmjs.org'",
|
|
46
47
|
"publint": "bun x publint@latest run --pack bun --strict",
|
|
47
|
-
"attw": "bun x @arethetypeswrong/cli@latest --pack . --ignore-rules='false-cjs' --ignore-rules='cjs-resolves-to-esm'",
|
|
48
|
+
"attw": "bun x @arethetypeswrong/cli@latest --pack . --ignore-rules='false-cjs' --ignore-rules='cjs-resolves-to-esm' --profile='node16'",
|
|
48
49
|
"prepublishOnly": "bun run build",
|
|
50
|
+
"prepack": "cp .github/README.md .",
|
|
51
|
+
"postpack": "rm README.md",
|
|
49
52
|
"prepare": "simple-git-hooks"
|
|
50
53
|
},
|
|
51
54
|
"dependencies": {
|
|
@@ -54,22 +57,28 @@
|
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@arethetypeswrong/core": "^0.18.2",
|
|
57
|
-
"@biomejs/biome": "^2.4.12",
|
|
58
60
|
"@changesets/changelog-github": "^0.6.0",
|
|
59
61
|
"@changesets/cli": "^2.30.0",
|
|
60
62
|
"@j178/prek": "^0.3.8",
|
|
63
|
+
"@rolldown/pluginutils": "^1.0.0-rc.15",
|
|
61
64
|
"@rspack/core": "^1.7.11",
|
|
65
|
+
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
62
66
|
"@sxzz/test-utils": "^0.5.16",
|
|
63
67
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
64
68
|
"@types/bun": "^1.3.12",
|
|
65
69
|
"@types/node": "^25.6.0",
|
|
66
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
70
|
+
"@typescript/native-preview": "^7.0.0-dev.20260421.1",
|
|
71
|
+
"astro": "^6.1.6",
|
|
72
|
+
"oxfmt": "^0.46.0",
|
|
73
|
+
"oxlint": "^1.61.0",
|
|
74
|
+
"oxlint-tsgolint": "^0.21.1",
|
|
67
75
|
"publint": "^0.3.18",
|
|
76
|
+
"rolldown": "^1.0.0-rc.15",
|
|
68
77
|
"rollup": "^4.60.1",
|
|
69
78
|
"simple-git-hooks": "^2.13.1",
|
|
70
79
|
"tsdown": "^0.21.8",
|
|
71
80
|
"tsx": "^4.21.0",
|
|
72
|
-
"typescript": "^6.0.
|
|
81
|
+
"typescript": "^6.0.3",
|
|
73
82
|
"unplugin-unused": "^0.5.7",
|
|
74
83
|
"unplugin-utils": "^0.3.1",
|
|
75
84
|
"vite": "^8.0.8",
|
|
@@ -126,21 +135,14 @@
|
|
|
126
135
|
"farm",
|
|
127
136
|
"astro"
|
|
128
137
|
],
|
|
129
|
-
"packageManager": "bun@1.3.
|
|
138
|
+
"packageManager": "bun@1.3.13",
|
|
130
139
|
"simple-git-hooks": {
|
|
131
140
|
"pre-commit": "bun prek run --all-files --config='.github/.pre-commit.yml'"
|
|
132
141
|
},
|
|
133
142
|
"license": "MIT",
|
|
134
143
|
"repository": "o-az/unplugin-cloudflare-tunnel",
|
|
135
|
-
"readme": "https://github.com/o-az/unplugin-cloudflare-tunnel/blob/main/.github/README.md",
|
|
136
144
|
"author": "Omar A <gh@omar.mov>",
|
|
137
145
|
"publishConfig": {
|
|
138
146
|
"access": "public"
|
|
139
|
-
},
|
|
140
|
-
"inlinedDependencies": {
|
|
141
|
-
"@oxc-project/types": "0.103.0",
|
|
142
|
-
"@rolldown/pluginutils": "1.0.0-beta.57",
|
|
143
|
-
"rolldown": "1.0.0-beta.57",
|
|
144
|
-
"zod": "4.3.6"
|
|
145
147
|
}
|
|
146
148
|
}
|
package/dist/api.d.mts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { a as ZodMiniObject, c as ZodMiniUnknown, i as ZodMiniNumber, n as ZodMiniBoolean, o as ZodMiniOptional, r as ZodMiniNullable, s as ZodMiniString, t as ZodMiniArray, u as $strip } from "./schemas-DKJtFAG_.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/api.d.ts
|
|
4
|
-
declare const CloudflareErrorSchema: ZodMiniObject<{
|
|
5
|
-
code: ZodMiniNumber<number>;
|
|
6
|
-
message: ZodMiniString<string>;
|
|
7
|
-
}, $strip>;
|
|
8
|
-
declare const CloudflareApiResponseSchema: ZodMiniObject<{
|
|
9
|
-
success: ZodMiniBoolean<boolean>;
|
|
10
|
-
errors: ZodMiniOptional<ZodMiniArray<ZodMiniObject<{
|
|
11
|
-
code: ZodMiniNumber<number>;
|
|
12
|
-
message: ZodMiniString<string>;
|
|
13
|
-
}, $strip>>>;
|
|
14
|
-
messages: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
|
|
15
|
-
result: ZodMiniUnknown;
|
|
16
|
-
}, $strip>;
|
|
17
|
-
declare const AccountSchema: ZodMiniObject<{
|
|
18
|
-
id: ZodMiniString<string>;
|
|
19
|
-
name: ZodMiniString<string>;
|
|
20
|
-
}, $strip>;
|
|
21
|
-
declare const ZoneSchema: ZodMiniObject<{
|
|
22
|
-
id: ZodMiniString<string>;
|
|
23
|
-
name: ZodMiniString<string>;
|
|
24
|
-
account: ZodMiniOptional<ZodMiniObject<{
|
|
25
|
-
id: ZodMiniString<string>;
|
|
26
|
-
}, $strip>>;
|
|
27
|
-
}, $strip>;
|
|
28
|
-
declare const TunnelSchema: ZodMiniObject<{
|
|
29
|
-
id: ZodMiniString<string>;
|
|
30
|
-
name: ZodMiniString<string>;
|
|
31
|
-
account_tag: ZodMiniString<string>;
|
|
32
|
-
created_at: ZodMiniString<string>;
|
|
33
|
-
connections: ZodMiniOptional<ZodMiniArray<ZodMiniUnknown>>;
|
|
34
|
-
}, $strip>;
|
|
35
|
-
declare const DNSRecordSchema: ZodMiniObject<{
|
|
36
|
-
id: ZodMiniString<string>;
|
|
37
|
-
type: ZodMiniString<string>;
|
|
38
|
-
name: ZodMiniString<string>;
|
|
39
|
-
content: ZodMiniString<string>;
|
|
40
|
-
proxied: ZodMiniBoolean<boolean>;
|
|
41
|
-
comment: ZodMiniOptional<ZodMiniNullable<ZodMiniString<string>>>;
|
|
42
|
-
}, $strip>;
|
|
43
|
-
declare function normalizeAddress(address: string | {
|
|
44
|
-
address?: string;
|
|
45
|
-
port?: number;
|
|
46
|
-
} | null | undefined): {
|
|
47
|
-
host: string;
|
|
48
|
-
port?: number;
|
|
49
|
-
};
|
|
50
|
-
declare function ensureCloudflaredBinary(binPath: string): Promise<void>;
|
|
51
|
-
declare function getLocalTarget(host: string, port: number): string;
|
|
52
|
-
//#endregion
|
|
53
|
-
export { AccountSchema, CloudflareApiResponseSchema, CloudflareErrorSchema, DNSRecordSchema, TunnelSchema, ZoneSchema, ensureCloudflaredBinary, getLocalTarget, normalizeAddress };
|
package/dist/api.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { a as number, c as string, i as nullish, l as unknown, n as array, o as object, r as boolean, s as optional } from "./schemas-Cpk3vGGi.mjs";
|
|
2
|
-
import NodeFS from "node:fs/promises";
|
|
3
|
-
import { install } from "cloudflared";
|
|
4
|
-
//#region src/api.ts
|
|
5
|
-
const CloudflareErrorSchema = object({
|
|
6
|
-
code: number(),
|
|
7
|
-
message: string()
|
|
8
|
-
});
|
|
9
|
-
const CloudflareApiResponseSchema = object({
|
|
10
|
-
success: boolean(),
|
|
11
|
-
errors: optional(array(CloudflareErrorSchema)),
|
|
12
|
-
messages: optional(array(string())),
|
|
13
|
-
result: unknown()
|
|
14
|
-
});
|
|
15
|
-
const AccountSchema = object({
|
|
16
|
-
id: string(),
|
|
17
|
-
name: string()
|
|
18
|
-
});
|
|
19
|
-
const ZoneSchema = object({
|
|
20
|
-
id: string(),
|
|
21
|
-
name: string(),
|
|
22
|
-
account: optional(object({ id: string() }))
|
|
23
|
-
});
|
|
24
|
-
const TunnelSchema = object({
|
|
25
|
-
id: string(),
|
|
26
|
-
name: string(),
|
|
27
|
-
account_tag: string(),
|
|
28
|
-
created_at: string(),
|
|
29
|
-
connections: optional(array(unknown()))
|
|
30
|
-
});
|
|
31
|
-
const DNSRecordSchema = object({
|
|
32
|
-
id: string(),
|
|
33
|
-
type: string(),
|
|
34
|
-
name: string(),
|
|
35
|
-
content: string(),
|
|
36
|
-
proxied: boolean(),
|
|
37
|
-
comment: nullish(string())
|
|
38
|
-
});
|
|
39
|
-
function normalizeAddress(address) {
|
|
40
|
-
if (address && typeof address === "object") return {
|
|
41
|
-
host: "address" in address && address.address ? address.address : "localhost",
|
|
42
|
-
port: "port" in address && typeof address.port === "number" ? address.port : void 0
|
|
43
|
-
};
|
|
44
|
-
return { host: "localhost" };
|
|
45
|
-
}
|
|
46
|
-
async function ensureCloudflaredBinary(binPath) {
|
|
47
|
-
try {
|
|
48
|
-
await NodeFS.access(binPath);
|
|
49
|
-
} catch {
|
|
50
|
-
console.log("[unplugin-cloudflare-tunnel] Installing cloudflared binary...");
|
|
51
|
-
await install(binPath);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function getLocalTarget(host, port) {
|
|
55
|
-
return `http://${host.includes(":") ? `[${host}]` : host}:${port}`;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { AccountSchema, CloudflareApiResponseSchema, CloudflareErrorSchema, DNSRecordSchema, TunnelSchema, ZoneSchema, ensureCloudflaredBinary, getLocalTarget, normalizeAddress };
|