buncargo 3.2.3 → 3.2.5

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.
Files changed (47) hide show
  1. package/dist/cli/bin.js +10 -10
  2. package/dist/cli/index.js +4 -2
  3. package/dist/core/network.js +1 -1
  4. package/dist/core/quick-tunnel/cloudflared-process.d.ts +3 -0
  5. package/dist/core/quick-tunnel/constants.d.ts +2 -0
  6. package/dist/core/quick-tunnel/index.d.ts +4 -3
  7. package/dist/core/utils.js +1 -1
  8. package/dist/docker/index.js +2 -2
  9. package/dist/environment/index.js +5 -5
  10. package/dist/index-1fset27q.js +72 -0
  11. package/dist/index-2bcjw5n0.js +666 -0
  12. package/dist/index-39s6ez1q.js +250 -0
  13. package/dist/index-5vg657rh.js +72 -0
  14. package/dist/index-6att53sd.js +250 -0
  15. package/dist/index-94kgbw4m.js +72 -0
  16. package/dist/index-96q4yh56.js +72 -0
  17. package/dist/index-bgcx898h.js +451 -0
  18. package/dist/index-c28x1pjb.js +250 -0
  19. package/dist/index-c2v0t0y2.js +250 -0
  20. package/dist/index-cm05c27w.js +417 -0
  21. package/dist/index-emcawhxm.js +250 -0
  22. package/dist/index-fkgqg6w2.js +125 -0
  23. package/dist/index-gfjdt37q.js +391 -0
  24. package/dist/index-gfs10vb8.js +389 -0
  25. package/dist/index-pbwvaz4v.js +666 -0
  26. package/dist/index-pmbmwg3x.js +72 -0
  27. package/dist/index-pt8t9tkg.js +389 -0
  28. package/dist/index-qnpd5fn5.js +666 -0
  29. package/dist/index-qtprmjbm.js +399 -0
  30. package/dist/index-qz66apm2.js +250 -0
  31. package/dist/index-thsdxz7m.js +250 -0
  32. package/dist/index-twwcjn9p.js +228 -0
  33. package/dist/index-tyk17rfn.js +666 -0
  34. package/dist/index-vj8kaz2d.js +72 -0
  35. package/dist/index-vr4ygtyj.js +415 -0
  36. package/dist/index-wmgx8rsm.js +666 -0
  37. package/dist/index-ymdvr5sn.js +666 -0
  38. package/dist/index-yw46g4tr.js +666 -0
  39. package/dist/index-znaek8z2.js +72 -0
  40. package/dist/index.js +25 -25
  41. package/dist/loader/index.js +6 -6
  42. package/package.json +3 -3
  43. package/src/core/quick-tunnel/cloudflared-process.ts +73 -12
  44. package/src/core/quick-tunnel/constants.ts +14 -1
  45. package/src/core/quick-tunnel/index.ts +82 -40
  46. package/src/core/quick-tunnel/install.ts +1 -1
  47. package/src/core/tunnel.ts +25 -21
package/dist/cli/bin.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  runCli
4
- } from "../index-n5g93an7.js";
4
+ } from "../index-c28x1pjb.js";
5
5
  import {
6
6
  loadDevEnv
7
- } from "../index-bycj26kj.js";
8
- import"../index-n6z0qw70.js";
9
- import"../index-d8tyv5se.js";
10
- import"../index-c0dr6mcv.js";
11
- import"../index-fb29934k.js";
7
+ } from "../index-znaek8z2.js";
8
+ import"../index-ymdvr5sn.js";
9
+ import"../index-twwcjn9p.js";
12
10
  import"../index-5t9jxqm0.js";
13
- import"../index-mf4vjhm3.js";
11
+ import"../index-bgcx898h.js";
14
12
  import"../index-mam0bcyz.js";
15
13
  import"../index-mm412dkp.js";
14
+ import"../index-fkgqg6w2.js";
15
+ import"../index-fb29934k.js";
16
16
  import"../index-t0fj6gg1.js";
17
17
  import {
18
18
  __commonJS,
@@ -23,7 +23,7 @@ import {
23
23
  var require_package = __commonJS((exports, module) => {
24
24
  module.exports = {
25
25
  name: "buncargo",
26
- version: "3.2.3",
26
+ version: "3.2.5",
27
27
  description: "A Bun-powered development environment CLI for managing Docker Compose services, dev servers, and environment variables",
28
28
  type: "module",
29
29
  module: "./dist/index.js",
@@ -156,8 +156,8 @@ var require_package = __commonJS((exports, module) => {
156
156
  "lint:write": "bun run typecheck && biome check --fix src example && biome format src example",
157
157
  typecheck: "tsgo --incremental",
158
158
  test: "bun test",
159
- "test:integration-cloudflared": "bun test src/core/quick-tunnel/quick-tunnel.test.ts",
160
- "test:integration-cloudflared-e2e": "BUNCARGO_TEST_CLOUDFLARED_E2E=1 bun test src/core/quick-tunnel/quick-tunnel.test.ts"
159
+ "test:integration-cloudflared": "BUNCARGO_TEST_CLOUDFLARED_SMOKE=1 bun test src/core/quick-tunnel/quick-tunnel.test.ts",
160
+ "test:integration-cloudflared-e2e": "BUNCARGO_TEST_CLOUDFLARED_SMOKE=1 BUNCARGO_TEST_CLOUDFLARED_E2E=1 bun test src/core/quick-tunnel/quick-tunnel.test.ts"
161
161
  },
162
162
  devDependencies: {
163
163
  "@types/bun": "1.3.2",
package/dist/cli/index.js CHANGED
@@ -2,10 +2,12 @@ import {
2
2
  getFlagValue,
3
3
  hasFlag,
4
4
  runCli
5
- } from "../index-n5g93an7.js";
6
- import"../index-mf4vjhm3.js";
5
+ } from "../index-c28x1pjb.js";
6
+ import"../index-bgcx898h.js";
7
7
  import"../index-mam0bcyz.js";
8
8
  import"../index-mm412dkp.js";
9
+ import"../index-fkgqg6w2.js";
10
+ import"../index-fb29934k.js";
9
11
  import"../index-qnx9j3qa.js";
10
12
  export {
11
13
  runCli,
@@ -3,7 +3,7 @@ import {
3
3
  isPortAvailable,
4
4
  waitForDevServers,
5
5
  waitForServer
6
- } from "../index-c0dr6mcv.js";
6
+ } from "../index-fkgqg6w2.js";
7
7
  import"../index-fb29934k.js";
8
8
  import"../index-qnx9j3qa.js";
9
9
  export {
@@ -3,6 +3,9 @@
3
3
  * Derived from unjs/untun (MIT), originally forked from node-cloudflared.
4
4
  */
5
5
  import { type ChildProcess } from "node:child_process";
6
+ /** Default 30s; set `BUNCARGO_QUICK_TUNNEL_TIMEOUT_MS=0` to disable. */
7
+ export declare function resolveQuickTunnelUrlTimeoutMs(): number;
8
+ export declare function parseQuickTunnelUrlFromOutput(log: string): string | null;
6
9
  export declare function startCloudflaredTunnel(options: Record<string, string | number | null>): {
7
10
  url: Promise<string>;
8
11
  child: ChildProcess;
@@ -6,4 +6,6 @@ export declare const CLOUDFLARED_VERSION: string;
6
6
  export declare const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
7
7
  /** Directory for buncargo-managed cloudflared (avoid clashing with untun's node-untun). */
8
8
  export declare const cloudflaredBinPath: string;
9
+ /** Spawn/install target: optional `BUNCARGO_CLOUDFLARED_PATH` overrides the bundled cache path. */
10
+ export declare function resolvedCloudflaredBinPath(): string;
9
11
  export declare const cloudflaredNotice = "\n\uD83D\uDD25 Your installation of cloudflared software constitutes a symbol of your signature\n indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.\n\n\u276F License: `https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/`\n\u276F Terms: `https://www.cloudflare.com/terms/`\n\u276F Privacy Policy: `https://www.cloudflare.com/privacypolicy/`\n";
@@ -1,10 +1,11 @@
1
+ /** True when trycloudflare.com is overloaded / rate-limited or returns non-JSON (cloudflared then errors on unmarshal). */
2
+ export declare function isRetryableQuickTunnelError(message: string): boolean;
1
3
  export interface QuickTunnelOptions {
2
4
  url?: string;
3
5
  port?: number | string;
4
6
  hostname?: string;
5
7
  protocol?: "http" | "https";
6
8
  verifyTLS?: boolean;
7
- acceptCloudflareNotice?: boolean;
8
9
  }
9
10
  export interface QuickTunnel {
10
11
  getURL: () => Promise<string>;
@@ -12,6 +13,6 @@ export interface QuickTunnel {
12
13
  }
13
14
  /**
14
15
  * Start a Cloudflare quick tunnel to a local HTTP(S) URL.
15
- * Returns undefined if the user declines the cloudflared install (when binary is missing).
16
+ * If the cloudflared binary is missing, prints the license notice and installs it from GitHub.
16
17
  */
17
- export declare function startQuickTunnel(opts: QuickTunnelOptions): Promise<QuickTunnel | undefined>;
18
+ export declare function startQuickTunnel(opts: QuickTunnelOptions): Promise<QuickTunnel>;
@@ -5,7 +5,7 @@ import {
5
5
  logExpoApiUrl,
6
6
  logFrontendPort,
7
7
  sleep
8
- } from "../index-c0dr6mcv.js";
8
+ } from "../index-fkgqg6w2.js";
9
9
  import"../index-fb29934k.js";
10
10
  import"../index-qnx9j3qa.js";
11
11
  export {
@@ -15,8 +15,8 @@ import {
15
15
  waitForAllServices,
16
16
  waitForService,
17
17
  waitForServiceByType
18
- } from "../index-d8tyv5se.js";
19
- import"../index-c0dr6mcv.js";
18
+ } from "../index-twwcjn9p.js";
19
+ import"../index-fkgqg6w2.js";
20
20
  import"../index-fb29934k.js";
21
21
  import"../index-qnx9j3qa.js";
22
22
  export {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createDevEnvironment
3
- } from "../index-n6z0qw70.js";
4
- import"../index-d8tyv5se.js";
5
- import"../index-c0dr6mcv.js";
6
- import"../index-fb29934k.js";
3
+ } from "../index-ymdvr5sn.js";
4
+ import"../index-twwcjn9p.js";
7
5
  import"../index-5t9jxqm0.js";
8
- import"../index-mf4vjhm3.js";
6
+ import"../index-bgcx898h.js";
9
7
  import"../index-mam0bcyz.js";
10
8
  import"../index-mm412dkp.js";
9
+ import"../index-fkgqg6w2.js";
10
+ import"../index-fb29934k.js";
11
11
  import"../index-t0fj6gg1.js";
12
12
  import"../index-qnx9j3qa.js";
13
13
  export {
@@ -0,0 +1,72 @@
1
+ import {
2
+ createDevEnvironment
3
+ } from "./index-tyk17rfn.js";
4
+
5
+ // src/loader/cache.ts
6
+ var cachedEnv = null;
7
+ function setCachedDevEnv(env) {
8
+ cachedEnv = env;
9
+ }
10
+ function getCachedDevEnv() {
11
+ return cachedEnv;
12
+ }
13
+ function clearDevEnvCache() {
14
+ cachedEnv = null;
15
+ }
16
+ // src/loader/find-config-file.ts
17
+ import { existsSync } from "node:fs";
18
+ import { dirname, join } from "node:path";
19
+ var CONFIG_FILES = [
20
+ "dev.config.ts",
21
+ "dev.config.js",
22
+ "dev-tools.config.ts",
23
+ "dev-tools.config.js"
24
+ ];
25
+ function findConfigFile(startDir) {
26
+ let currentDir = startDir;
27
+ while (true) {
28
+ for (const file of CONFIG_FILES) {
29
+ const configPath = join(currentDir, file);
30
+ if (existsSync(configPath)) {
31
+ return configPath;
32
+ }
33
+ }
34
+ const parentDir = dirname(currentDir);
35
+ if (parentDir === currentDir) {
36
+ return null;
37
+ }
38
+ currentDir = parentDir;
39
+ }
40
+ }
41
+ // src/loader/load-dev-env.ts
42
+ async function loadDevEnv(options) {
43
+ if (!options?.reload) {
44
+ const cached = getCachedDevEnv();
45
+ if (cached)
46
+ return cached;
47
+ }
48
+ const cwd = options?.cwd ?? process.cwd();
49
+ const configPath = findConfigFile(cwd);
50
+ if (configPath) {
51
+ const mod = await import(configPath);
52
+ const config = mod.default;
53
+ if (!config?.projectPrefix || !config?.services) {
54
+ throw new Error(`Invalid config in "${configPath}". Use defineDevConfig() and export as default.`);
55
+ }
56
+ const env = createDevEnvironment(config);
57
+ setCachedDevEnv(env);
58
+ return env;
59
+ }
60
+ throw new Error("No config file found. Create dev.config.ts with: export default defineDevConfig({ ... })");
61
+ }
62
+
63
+ // src/loader/index.ts
64
+ function getDevEnv() {
65
+ const env = getCachedDevEnv();
66
+ if (!env) {
67
+ throw new Error("Dev environment not loaded. Call loadDevEnv() first.");
68
+ }
69
+ return env;
70
+ }
71
+
72
+ export { clearDevEnvCache, CONFIG_FILES, findConfigFile, loadDevEnv, getDevEnv };