@effectstream/utils 0.100.7 → 0.100.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/package.json CHANGED
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "name": "@effectstream/utils",
3
- "version": "0.100.7",
3
+ "version": "0.100.9",
4
4
  "license": "MIT",
5
+ "homepage": "https://effectstream.github.io/docs/",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/PaimaStudios/paima-engine",
9
+ "directory": "packages/effectstream-sdk/utils"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/PaimaStudios/paima-engine/issues"
13
+ },
5
14
  "exports": {
6
15
  ".": "./src/mod.ts",
7
16
  "./node-env": "./src/config.ts",
8
17
  "./runtime": "./src/runtime.ts",
9
- "./runtime-spawn": "./src/runtime-spawn.ts",
10
- "./wait-tcp": "./src/wait-tcp.ts",
11
- "./wait-http": "./src/wait-http.ts"
18
+ "./runtime-spawn": "./src/runtime-spawn.ts"
12
19
  },
13
20
  "dependencies": {
14
21
  "@coderspirit/nominal": "^4.1.1",
@@ -26,5 +33,6 @@
26
33
  "js-base64": "^3.7.7",
27
34
  "js-sha512": "^0.9.0",
28
35
  "viem": "2.37.3"
29
- }
36
+ },
37
+ "description": "Shared utilities for the EffectStream framework"
30
38
  }
package/src/wait-http.ts DELETED
@@ -1,24 +0,0 @@
1
- const url = process.argv.at(-1);
2
- if (!url || !url.startsWith("http")) {
3
- console.error("Usage: bun wait-http.ts <url>");
4
- process.exit(1);
5
- }
6
-
7
- const timeout = Number(process.argv.includes("--timeout")
8
- ? process.argv[process.argv.indexOf("--timeout") + 1]
9
- : 60000);
10
-
11
- const start = Date.now();
12
-
13
- while (Date.now() - start < timeout) {
14
- try {
15
- const res = await fetch(url);
16
- if (res.ok) process.exit(0);
17
- } catch {
18
- // not ready yet
19
- }
20
- await Bun.sleep(500);
21
- }
22
-
23
- console.error(`Timed out waiting for ${url}`);
24
- process.exit(1);
package/src/wait-tcp.ts DELETED
@@ -1,30 +0,0 @@
1
- const port = Number(process.argv.at(-1));
2
- if (!port || isNaN(port)) {
3
- console.error("Usage: bun wait-tcp.ts <port>");
4
- process.exit(1);
5
- }
6
-
7
- for (let i = 0; i < 120; i++) {
8
- try {
9
- const connected = await new Promise<boolean>((resolve) => {
10
- Bun.connect({
11
- hostname: "127.0.0.1",
12
- port,
13
- socket: {
14
- open(socket) { socket.end(); resolve(true); },
15
- data() {},
16
- error() { resolve(false); },
17
- close() {},
18
- connectError() { resolve(false); },
19
- },
20
- }).catch(() => resolve(false));
21
- });
22
- if (connected) process.exit(0);
23
- } catch {
24
- // fallthrough to retry
25
- }
26
- await Bun.sleep(500);
27
- }
28
-
29
- console.error(`Timed out waiting for tcp:${port}`);
30
- process.exit(1);