buncargo 3.2.0 → 3.2.4

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/bin.js CHANGED
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  runCli
4
- } from "../index-5aq985p4.js";
4
+ } from "../index-emcawhxm.js";
5
5
  import {
6
6
  loadDevEnv
7
- } from "../index-byeqyjrz.js";
8
- import"../index-7v19es2e.js";
9
- import"../index-d8tyv5se.js";
10
- import"../index-c0dr6mcv.js";
11
- import"../index-fb29934k.js";
7
+ } from "../index-1fset27q.js";
8
+ import"../index-tyk17rfn.js";
9
+ import"../index-twwcjn9p.js";
12
10
  import"../index-5t9jxqm0.js";
13
- import"../index-x54nbgs7.js";
11
+ import"../index-vr4ygtyj.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.0",
26
+ version: "3.2.4",
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-5aq985p4.js";
6
- import"../index-x54nbgs7.js";
5
+ } from "../index-emcawhxm.js";
6
+ import"../index-vr4ygtyj.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,7 @@
3
3
  * Derived from unjs/untun (MIT), originally forked from node-cloudflared.
4
4
  */
5
5
  import { type ChildProcess } from "node:child_process";
6
+ export declare function parseQuickTunnelUrlFromOutput(log: string): string | null;
6
7
  export declare function startCloudflaredTunnel(options: Record<string, string | number | null>): {
7
8
  url: Promise<string>;
8
9
  child: ChildProcess;
@@ -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-7v19es2e.js";
4
- import"../index-d8tyv5se.js";
5
- import"../index-c0dr6mcv.js";
6
- import"../index-fb29934k.js";
3
+ } from "../index-tyk17rfn.js";
4
+ import"../index-twwcjn9p.js";
7
5
  import"../index-5t9jxqm0.js";
8
- import"../index-x54nbgs7.js";
6
+ import"../index-vr4ygtyj.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 };