buncargo 3.2.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.
- package/dist/cli/bin.js +5 -5
- package/dist/cli/index.js +2 -2
- package/dist/environment/index.js +2 -2
- package/dist/index-bycj26kj.js +72 -0
- package/dist/index-mf4vjhm3.js +362 -0
- package/dist/index-n5g93an7.js +250 -0
- package/dist/index-n6z0qw70.js +666 -0
- package/dist/index.js +4 -4
- package/dist/loader/index.js +3 -3
- package/package.json +1 -1
- package/src/core/tunnel.ts +20 -8
package/src/core/tunnel.ts
CHANGED
|
@@ -124,10 +124,9 @@ export async function startPublicTunnels(
|
|
|
124
124
|
} = {},
|
|
125
125
|
): Promise<PublicTunnel[]> {
|
|
126
126
|
const start = options.start ?? ((input) => startQuickTunnel(input));
|
|
127
|
-
const tunnels: PublicTunnel[] = [];
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
const settled = await Promise.allSettled(
|
|
129
|
+
targets.map(async (target) => {
|
|
131
130
|
const localUrl = `http://localhost:${target.port}`;
|
|
132
131
|
const tunnel = (await start({
|
|
133
132
|
url: localUrl,
|
|
@@ -143,19 +142,32 @@ export async function startPublicTunnels(
|
|
|
143
142
|
`Tunnel for "${target.name}" did not provide a public URL`,
|
|
144
143
|
);
|
|
145
144
|
}
|
|
146
|
-
|
|
145
|
+
return {
|
|
147
146
|
kind: target.kind,
|
|
148
147
|
name: target.name,
|
|
149
148
|
localUrl,
|
|
150
149
|
publicUrl,
|
|
151
150
|
close: toCloseFn(tunnel),
|
|
152
|
-
}
|
|
151
|
+
};
|
|
152
|
+
}),
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const tunnels: PublicTunnel[] = [];
|
|
156
|
+
const errors: unknown[] = [];
|
|
157
|
+
for (const result of settled) {
|
|
158
|
+
if (result.status === "fulfilled") {
|
|
159
|
+
tunnels.push(result.value);
|
|
160
|
+
} else {
|
|
161
|
+
errors.push(result.reason);
|
|
153
162
|
}
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (errors.length > 0) {
|
|
156
166
|
await stopPublicTunnels(tunnels);
|
|
157
|
-
throw
|
|
167
|
+
throw errors[0];
|
|
158
168
|
}
|
|
169
|
+
|
|
170
|
+
return tunnels;
|
|
159
171
|
}
|
|
160
172
|
|
|
161
173
|
export async function stopPublicTunnels(
|