buncargo 3.0.0 → 3.2.3

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 -8
  2. package/dist/cli/index.js +2 -2
  3. package/dist/cli/run-cli.d.ts +10 -2
  4. package/dist/core/quick-tunnel/cloudflared-process.d.ts +10 -0
  5. package/dist/core/quick-tunnel/constants.d.ts +9 -0
  6. package/dist/core/quick-tunnel/index.d.ts +17 -0
  7. package/dist/core/quick-tunnel/install.d.ts +1 -0
  8. package/dist/core/tunnel.d.ts +3 -2
  9. package/dist/environment/index.js +2 -2
  10. package/dist/environment/logging.d.ts +6 -6
  11. package/dist/environment/only-apps.d.ts +10 -0
  12. package/dist/index-3eyrdxw9.js +577 -0
  13. package/dist/index-5aq985p4.js +250 -0
  14. package/dist/index-6cmex7m5.js +72 -0
  15. package/dist/index-6d6x175r.js +572 -0
  16. package/dist/index-7v19es2e.js +666 -0
  17. package/dist/index-9wyhzw0h.js +574 -0
  18. package/dist/index-ag90ry8t.js +576 -0
  19. package/dist/index-bycj26kj.js +72 -0
  20. package/dist/index-byeqyjrz.js +72 -0
  21. package/dist/index-enj4zdma.js +574 -0
  22. package/dist/index-k370bech.js +72 -0
  23. package/dist/index-mf4vjhm3.js +362 -0
  24. package/dist/index-n5g93an7.js +250 -0
  25. package/dist/index-n6z0qw70.js +666 -0
  26. package/dist/index-qa8akv6y.js +666 -0
  27. package/dist/index-vg55rq0y.js +250 -0
  28. package/dist/index-vs81yaks.js +244 -0
  29. package/dist/index-x54nbgs7.js +355 -0
  30. package/dist/index-yz4jfz7z.js +338 -0
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +9 -8
  33. package/dist/loader/index.js +3 -3
  34. package/dist/types/all-types.d.ts +46 -3
  35. package/package.json +147 -145
  36. package/readme.md +16 -0
  37. package/src/cli/run-cli.ts +27 -12
  38. package/src/core/quick-tunnel/cloudflared-process.ts +83 -0
  39. package/src/core/quick-tunnel/constants.ts +31 -0
  40. package/src/core/quick-tunnel/index.ts +96 -0
  41. package/src/core/quick-tunnel/install.ts +160 -0
  42. package/src/core/tunnel.ts +42 -16
  43. package/src/environment/create-dev-environment.ts +123 -13
  44. package/src/environment/logging.ts +34 -20
  45. package/src/environment/only-apps.ts +34 -0
  46. package/src/index.ts +3 -0
  47. package/src/types/all-types.ts +56 -3
package/dist/cli/bin.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  runCli
4
- } from "../index-0kxnae3z.js";
4
+ } from "../index-n5g93an7.js";
5
5
  import {
6
6
  loadDevEnv
7
- } from "../index-4xrxh8yv.js";
8
- import"../index-ma6tgdb2.js";
7
+ } from "../index-bycj26kj.js";
8
+ import"../index-n6z0qw70.js";
9
9
  import"../index-d8tyv5se.js";
10
10
  import"../index-c0dr6mcv.js";
11
11
  import"../index-fb29934k.js";
12
12
  import"../index-5t9jxqm0.js";
13
- import"../index-bnk6nr0g.js";
13
+ import"../index-mf4vjhm3.js";
14
14
  import"../index-mam0bcyz.js";
15
15
  import"../index-mm412dkp.js";
16
16
  import"../index-t0fj6gg1.js";
@@ -23,7 +23,7 @@ import {
23
23
  var require_package = __commonJS((exports, module) => {
24
24
  module.exports = {
25
25
  name: "buncargo",
26
- version: "3.0.0",
26
+ version: "3.2.3",
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",
@@ -154,7 +154,10 @@ var require_package = __commonJS((exports, module) => {
154
154
  "publish:major": "npm version major && npm publish",
155
155
  lint: "bun run typecheck && biome check src example",
156
156
  "lint:write": "bun run typecheck && biome check --fix src example && biome format src example",
157
- typecheck: "tsgo --incremental"
157
+ typecheck: "tsgo --incremental",
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"
158
161
  },
159
162
  devDependencies: {
160
163
  "@types/bun": "1.3.2",
@@ -164,8 +167,7 @@ var require_package = __commonJS((exports, module) => {
164
167
  },
165
168
  dependencies: {
166
169
  "fast-glob": "^3.3.3",
167
- picocolors: "^1.1.1",
168
- untun: "^0.1.3"
170
+ picocolors: "^1.1.1"
169
171
  }
170
172
  };
171
173
  });
package/dist/cli/index.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  getFlagValue,
3
3
  hasFlag,
4
4
  runCli
5
- } from "../index-0kxnae3z.js";
6
- import"../index-bnk6nr0g.js";
5
+ } from "../index-n5g93an7.js";
6
+ import"../index-mf4vjhm3.js";
7
7
  import"../index-mam0bcyz.js";
8
8
  import"../index-mm412dkp.js";
9
9
  import"../index-qnx9j3qa.js";
@@ -1,3 +1,4 @@
1
+ import { resolveExposeTargets, startPublicTunnels, stopPublicTunnels } from "../core/tunnel";
1
2
  import type { AppConfig, CliOptions, DevEnvironment, ServiceConfig } from "../types";
2
3
  /**
3
4
  * Run the CLI for a dev environment.
@@ -11,9 +12,16 @@ import type { AppConfig, CliOptions, DevEnvironment, ServiceConfig } from "../ty
11
12
  * await runCli(dev)
12
13
  * ```
13
14
  */
14
- export declare function runCli<TServices extends Record<string, ServiceConfig>, TApps extends Record<string, AppConfig>>(env: DevEnvironment<TServices, TApps>, options?: CliOptions): Promise<void>;
15
+ export declare function runCli<TServices extends Record<string, ServiceConfig>, TApps extends Record<string, AppConfig>>(env: DevEnvironment<TServices, TApps>, options?: CliOptions & {
16
+ /** Substitute tunnel helpers (used by CLI integration tests). */
17
+ cliTestTunnel?: {
18
+ resolveExposeTargets: typeof resolveExposeTargets;
19
+ startPublicTunnels: typeof startPublicTunnels;
20
+ stopPublicTunnels: typeof stopPublicTunnels;
21
+ };
22
+ }): Promise<void>;
15
23
  /**
16
- * Check if a CLI flag is present.
24
+ * Check if a CLI flag is present (including `--flag=value` form).
17
25
  */
18
26
  export declare function hasFlag(args: string[], flag: string): boolean;
19
27
  /**
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Spawn cloudflared and parse the quick-tunnel public URL from output.
3
+ * Derived from unjs/untun (MIT), originally forked from node-cloudflared.
4
+ */
5
+ import { type ChildProcess } from "node:child_process";
6
+ export declare function startCloudflaredTunnel(options: Record<string, string | number | null>): {
7
+ url: Promise<string>;
8
+ child: ChildProcess;
9
+ stop: () => boolean;
10
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Paths and release metadata for the cloudflared binary.
3
+ * Derived from unjs/untun (MIT), originally forked from node-cloudflared.
4
+ */
5
+ export declare const CLOUDFLARED_VERSION: string;
6
+ export declare const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
7
+ /** Directory for buncargo-managed cloudflared (avoid clashing with untun's node-untun). */
8
+ export declare const cloudflaredBinPath: string;
9
+ 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";
@@ -0,0 +1,17 @@
1
+ export interface QuickTunnelOptions {
2
+ url?: string;
3
+ port?: number | string;
4
+ hostname?: string;
5
+ protocol?: "http" | "https";
6
+ verifyTLS?: boolean;
7
+ acceptCloudflareNotice?: boolean;
8
+ }
9
+ export interface QuickTunnel {
10
+ getURL: () => Promise<string>;
11
+ close: () => Promise<void>;
12
+ }
13
+ /**
14
+ * 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
+ */
17
+ export declare function startQuickTunnel(opts: QuickTunnelOptions): Promise<QuickTunnel | undefined>;
@@ -0,0 +1 @@
1
+ export declare function installCloudflared(to?: string, version?: string): Promise<string>;
@@ -11,7 +11,8 @@ export interface PublicTunnel {
11
11
  publicUrl: string;
12
12
  close: () => Promise<void>;
13
13
  }
14
- interface UntunTunnelLike {
14
+ interface TunnelBackendResult {
15
+ getURL?: () => Promise<string>;
15
16
  url?: string;
16
17
  publicUrl?: string;
17
18
  tunnelUrl?: string;
@@ -27,7 +28,7 @@ export declare function resolveExposeTargets<TServices extends Record<string, Se
27
28
  export declare function startPublicTunnels(targets: PublicExposeTarget[], options?: {
28
29
  start?: (input: {
29
30
  url: string;
30
- }) => Promise<UntunTunnelLike>;
31
+ }) => Promise<TunnelBackendResult | undefined>;
31
32
  }): Promise<PublicTunnel[]>;
32
33
  export declare function stopPublicTunnels(tunnels: PublicTunnel[]): Promise<void>;
33
34
  export {};
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createDevEnvironment
3
- } from "../index-ma6tgdb2.js";
3
+ } from "../index-n6z0qw70.js";
4
4
  import"../index-d8tyv5se.js";
5
5
  import"../index-c0dr6mcv.js";
6
6
  import"../index-fb29934k.js";
7
7
  import"../index-5t9jxqm0.js";
8
- import"../index-bnk6nr0g.js";
8
+ import"../index-mf4vjhm3.js";
9
9
  import"../index-mam0bcyz.js";
10
10
  import"../index-mm412dkp.js";
11
11
  import"../index-t0fj6gg1.js";
@@ -8,10 +8,10 @@ export declare function logEnvironmentInfo(input: {
8
8
  worktree: boolean;
9
9
  portOffset: number;
10
10
  projectSuffix?: string;
11
+ tunnels?: Array<{
12
+ kind: "service" | "app";
13
+ name: string;
14
+ publicUrl: string;
15
+ localUrl: string;
16
+ }>;
11
17
  }): void;
12
- export declare function logPublicUrls(tunnels: Array<{
13
- kind: "service" | "app";
14
- name: string;
15
- publicUrl: string;
16
- localUrl: string;
17
- }>): void;
@@ -0,0 +1,10 @@
1
+ import type { AppConfig } from "../types";
2
+ /**
3
+ * Ensures every name in `onlyApps` exists as a key in `apps`.
4
+ */
5
+ export declare function assertOnlyAppNames(appKeys: string[], onlyApps: string[] | undefined): void;
6
+ /**
7
+ * Returns a subset of `apps` when `onlyApps` is set; otherwise the full map.
8
+ * When `onlyApps` is `[]`, returns `{}`.
9
+ */
10
+ export declare function pickApps<TApps extends Record<string, AppConfig>>(apps: TApps, onlyApps: string[] | undefined): Record<string, AppConfig>;