@jamiexiongr/panda 0.1.7 → 0.1.9

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/dist/cli.mjs CHANGED
@@ -1,6 +1,101 @@
1
- import {
2
- resolveTailscalePublicationMode
3
- } from "./chunk-JBN6ZR6W.mjs";
1
+ // packages/provider-codex/src/tailscale.ts
2
+ import { execFileSync } from "child_process";
3
+ var ENABLED_ARGS = /* @__PURE__ */ new Set([
4
+ "tailscareserv",
5
+ "--tailscareserv",
6
+ "tailscale-serve",
7
+ "--tailscale-serve"
8
+ ]);
9
+ var PUBLIC_ARGS = /* @__PURE__ */ new Set([
10
+ "tailscareserv-pub",
11
+ "--tailscareserv-pub",
12
+ "tailscale-serve-pub",
13
+ "--tailscale-serve-pub",
14
+ "tailscalefunnel",
15
+ "--tailscalefunnel",
16
+ "tailscale-funnel",
17
+ "--tailscale-funnel"
18
+ ]);
19
+ var DISABLED_ARGS = /* @__PURE__ */ new Set([
20
+ "no-tailscareserv",
21
+ "--no-tailscareserv",
22
+ "no-tailscale-serve",
23
+ "--no-tailscale-serve",
24
+ "no-tailscareserv-pub",
25
+ "--no-tailscareserv-pub",
26
+ "no-tailscale-serve-pub",
27
+ "--no-tailscale-serve-pub",
28
+ "no-tailscalefunnel",
29
+ "--no-tailscalefunnel",
30
+ "no-tailscale-funnel",
31
+ "--no-tailscale-funnel"
32
+ ]);
33
+ var trimToNull = (value) => {
34
+ const normalized = value?.trim() ?? "";
35
+ return normalized ? normalized : null;
36
+ };
37
+ var parseBooleanLike = (value) => {
38
+ const normalized = trimToNull(value)?.toLowerCase();
39
+ if (!normalized) {
40
+ return null;
41
+ }
42
+ if (["1", "true", "yes", "on"].includes(normalized)) {
43
+ return true;
44
+ }
45
+ if (["0", "false", "no", "off"].includes(normalized)) {
46
+ return false;
47
+ }
48
+ return null;
49
+ };
50
+ var parsePublicationModeLike = (value) => {
51
+ const normalized = trimToNull(value)?.toLowerCase();
52
+ if (!normalized) {
53
+ return null;
54
+ }
55
+ if (["serve", "private", "tailnet"].includes(normalized)) {
56
+ return "serve";
57
+ }
58
+ if (["funnel", "public", "pub"].includes(normalized)) {
59
+ return "funnel";
60
+ }
61
+ if (["disabled", "none", "off"].includes(normalized)) {
62
+ return "disabled";
63
+ }
64
+ return null;
65
+ };
66
+ var resolveTailscalePublicationMode = (options) => {
67
+ const argv = options?.argv ?? [];
68
+ for (const candidate of argv) {
69
+ const normalized = candidate.trim().toLowerCase();
70
+ if (PUBLIC_ARGS.has(normalized)) {
71
+ return "funnel";
72
+ }
73
+ if (ENABLED_ARGS.has(normalized)) {
74
+ return "serve";
75
+ }
76
+ if (DISABLED_ARGS.has(normalized)) {
77
+ return "disabled";
78
+ }
79
+ }
80
+ const env = options?.env ?? process.env;
81
+ const scopedMode = options?.envPrefix ? parsePublicationModeLike(env[`${options.envPrefix}_TAILSCALE_PUBLISH_MODE`]) : null;
82
+ if (scopedMode) {
83
+ return scopedMode;
84
+ }
85
+ const genericMode = parsePublicationModeLike(env.PANDA_TAILSCALE_PUBLISH_MODE);
86
+ if (genericMode) {
87
+ return genericMode;
88
+ }
89
+ const scopedEnabled = options?.envPrefix ? parseBooleanLike(env[`${options.envPrefix}_TAILSCALE_SERVE`]) : null;
90
+ if (scopedEnabled !== null) {
91
+ return scopedEnabled ? "serve" : "disabled";
92
+ }
93
+ const envEnabled = parseBooleanLike(env.PANDA_TAILSCALE_SERVE);
94
+ if (envEnabled !== null) {
95
+ return envEnabled ? "serve" : "disabled";
96
+ }
97
+ return "disabled";
98
+ };
4
99
 
5
100
  // release/panda/src/cli.ts
6
101
  var printUsage = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamiexiongr/panda",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Panda combined installer",
@@ -8,8 +8,8 @@
8
8
  "panda": "./bin/panda.cjs"
9
9
  },
10
10
  "dependencies": {
11
- "@jamiexiongr/panda-agent": "0.1.7",
12
- "@jamiexiongr/panda-hub": "0.1.7"
11
+ "@jamiexiongr/panda-agent": "0.1.9",
12
+ "@jamiexiongr/panda-hub": "0.1.9"
13
13
  },
14
14
  "files": [
15
15
  "bin",