@livestore/utils-dev 0.4.0-dev.7 → 0.4.0-dev.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.
Files changed (68) hide show
  1. package/dist/.tsbuildinfo.json +1 -1
  2. package/dist/node/DockerComposeService/DockerComposeService.d.ts +12 -2
  3. package/dist/node/DockerComposeService/DockerComposeService.d.ts.map +1 -1
  4. package/dist/node/DockerComposeService/DockerComposeService.js +54 -17
  5. package/dist/node/DockerComposeService/DockerComposeService.js.map +1 -1
  6. package/dist/node/mod.d.ts +0 -2
  7. package/dist/node/mod.d.ts.map +1 -1
  8. package/dist/node/mod.js +0 -2
  9. package/dist/node/mod.js.map +1 -1
  10. package/dist/node-vitest/Vitest.d.ts +6 -6
  11. package/dist/node-vitest/Vitest.d.ts.map +1 -1
  12. package/dist/node-vitest/Vitest.js +2 -2
  13. package/dist/node-vitest/Vitest.js.map +1 -1
  14. package/dist/node-vitest/Vitest.test.js +12 -1
  15. package/dist/node-vitest/Vitest.test.js.map +1 -1
  16. package/dist/{node/WranglerDevServer → wrangler}/WranglerDevServer.d.ts +6 -6
  17. package/dist/wrangler/WranglerDevServer.d.ts.map +1 -0
  18. package/dist/wrangler/WranglerDevServer.js +90 -0
  19. package/dist/wrangler/WranglerDevServer.js.map +1 -0
  20. package/dist/wrangler/WranglerDevServer.test.d.ts.map +1 -0
  21. package/dist/wrangler/WranglerDevServer.test.js +77 -0
  22. package/dist/wrangler/WranglerDevServer.test.js.map +1 -0
  23. package/dist/wrangler/fixtures/cf-worker.d.ts.map +1 -0
  24. package/dist/wrangler/fixtures/cf-worker.js.map +1 -0
  25. package/dist/wrangler/mod.d.ts +2 -0
  26. package/dist/wrangler/mod.d.ts.map +1 -0
  27. package/dist/wrangler/mod.js +2 -0
  28. package/dist/wrangler/mod.js.map +1 -0
  29. package/package.json +7 -4
  30. package/src/node/DockerComposeService/DockerComposeService.ts +99 -23
  31. package/src/node/mod.ts +0 -7
  32. package/src/node-vitest/Vitest.test.ts +12 -1
  33. package/src/node-vitest/Vitest.ts +31 -19
  34. package/src/wrangler/WranglerDevServer.test.ts +133 -0
  35. package/src/wrangler/WranglerDevServer.ts +180 -0
  36. package/src/wrangler/mod.ts +6 -0
  37. package/dist/node/WranglerDevServer/WranglerDevServer.d.ts.map +0 -1
  38. package/dist/node/WranglerDevServer/WranglerDevServer.js +0 -122
  39. package/dist/node/WranglerDevServer/WranglerDevServer.js.map +0 -1
  40. package/dist/node/WranglerDevServer/WranglerDevServer.test.d.ts.map +0 -1
  41. package/dist/node/WranglerDevServer/WranglerDevServer.test.js +0 -179
  42. package/dist/node/WranglerDevServer/WranglerDevServer.test.js.map +0 -1
  43. package/dist/node/WranglerDevServer/fixtures/cf-worker.d.ts.map +0 -1
  44. package/dist/node/WranglerDevServer/fixtures/cf-worker.js.map +0 -1
  45. package/dist/node/WranglerDevServer/process-tree-manager.d.ts +0 -55
  46. package/dist/node/WranglerDevServer/process-tree-manager.d.ts.map +0 -1
  47. package/dist/node/WranglerDevServer/process-tree-manager.js +0 -178
  48. package/dist/node/WranglerDevServer/process-tree-manager.js.map +0 -1
  49. package/dist/node/vitest-docker-compose-setup.d.ts +0 -32
  50. package/dist/node/vitest-docker-compose-setup.d.ts.map +0 -1
  51. package/dist/node/vitest-docker-compose-setup.js +0 -131
  52. package/dist/node/vitest-docker-compose-setup.js.map +0 -1
  53. package/dist/node/vitest-wrangler-setup.d.ts +0 -27
  54. package/dist/node/vitest-wrangler-setup.d.ts.map +0 -1
  55. package/dist/node/vitest-wrangler-setup.js +0 -96
  56. package/dist/node/vitest-wrangler-setup.js.map +0 -1
  57. package/dist/node-vitest/polyfill.d.ts +0 -2
  58. package/dist/node-vitest/polyfill.d.ts.map +0 -1
  59. package/dist/node-vitest/polyfill.js +0 -3
  60. package/dist/node-vitest/polyfill.js.map +0 -1
  61. package/src/node/WranglerDevServer/WranglerDevServer.test.ts +0 -266
  62. package/src/node/WranglerDevServer/WranglerDevServer.ts +0 -266
  63. package/src/node/WranglerDevServer/process-tree-manager.ts +0 -263
  64. /package/dist/{node/WranglerDevServer → wrangler}/WranglerDevServer.test.d.ts +0 -0
  65. /package/dist/{node/WranglerDevServer → wrangler}/fixtures/cf-worker.d.ts +0 -0
  66. /package/dist/{node/WranglerDevServer → wrangler}/fixtures/cf-worker.js +0 -0
  67. /package/src/{node/WranglerDevServer → wrangler}/fixtures/cf-worker.ts +0 -0
  68. /package/src/{node/WranglerDevServer → wrangler}/fixtures/wrangler.toml +0 -0
@@ -0,0 +1,180 @@
1
+ import * as path from 'node:path'
2
+ import * as Toml from '@iarna/toml'
3
+ import { IS_CI } from '@livestore/utils'
4
+ import { Cause, Duration, Effect, FileSystem, HttpClient, Schedule, Schema } from '@livestore/utils/effect'
5
+ import { getFreePort } from '@livestore/utils/node'
6
+ import * as wrangler from 'wrangler'
7
+
8
+ /**
9
+ * Error type for WranglerDevServer operations
10
+ */
11
+ export class WranglerDevServerError extends Schema.TaggedError<WranglerDevServerError>()('WranglerDevServerError', {
12
+ cause: Schema.Unknown,
13
+ message: Schema.String,
14
+ port: Schema.Number,
15
+ }) {}
16
+
17
+ /**
18
+ * WranglerDevServer instance interface
19
+ */
20
+ export interface WranglerDevServer {
21
+ readonly port: number
22
+ readonly url: string
23
+ // readonly processId: number
24
+ }
25
+
26
+ /**
27
+ * Configuration for starting WranglerDevServer
28
+ */
29
+ export interface StartWranglerDevServerArgs {
30
+ wranglerConfigPath?: string
31
+ cwd: string
32
+ /** The port to try first. The dev server may bind a different port if unavailable. */
33
+ preferredPort?: number
34
+ /** @default false */
35
+ showLogs?: boolean
36
+ inspectorPort?: number
37
+ connectTimeout?: Duration.DurationInput
38
+ }
39
+
40
+ /**
41
+ * WranglerDevServer as an Effect.Service.
42
+ *
43
+ * This service provides the WranglerDevServer properties and can be accessed
44
+ * directly to get port and url.
45
+ *
46
+ * TODO: Allow for config to be passed in via code instead of `wrangler.toml` file
47
+ * (would need to be placed in temporary file as wrangler only accepts files as config)
48
+ */
49
+ export class WranglerDevServerService extends Effect.Service<WranglerDevServerService>()('WranglerDevServerService', {
50
+ scoped: (args: StartWranglerDevServerArgs) =>
51
+ Effect.gen(function* () {
52
+ const showLogs = args.showLogs ?? false
53
+
54
+ // Allocate preferred port (Wrangler may bind a different one if unavailable)
55
+ const preferredPort =
56
+ args.preferredPort ??
57
+ (yield* getFreePort.pipe(
58
+ Effect.mapError(
59
+ (cause) => new WranglerDevServerError({ cause, message: 'Failed to get free port', port: -1 }),
60
+ ),
61
+ ))
62
+
63
+ yield* Effect.annotateCurrentSpan({ preferredPort })
64
+
65
+ const configPath = path.resolve(args.wranglerConfigPath ?? path.join(args.cwd, 'wrangler.toml'))
66
+
67
+ const fs = yield* FileSystem.FileSystem
68
+ const configContent = yield* fs.readFileString(configPath)
69
+ const parsedConfig = yield* Effect.try(() => Toml.parse(configContent)).pipe(
70
+ Effect.andThen(Schema.decodeUnknown(Schema.Struct({ main: Schema.String }))),
71
+ Effect.mapError(
72
+ (error) => new WranglerDevServerError({ cause: error, message: 'Failed to parse wrangler config', port: -1 }),
73
+ ),
74
+ )
75
+ const resolvedMainPath = yield* Effect.try(() => path.resolve(args.cwd, parsedConfig.main))
76
+
77
+ const devServer = yield* Effect.promise(() =>
78
+ wrangler.unstable_dev(resolvedMainPath, {
79
+ config: configPath,
80
+ port: preferredPort,
81
+ inspectorPort: args.inspectorPort ?? 0,
82
+ persistTo: path.join(args.cwd, '.wrangler/state'),
83
+ logLevel: showLogs ? 'debug' : 'none',
84
+ experimental: {
85
+ disableExperimentalWarning: true,
86
+ },
87
+ }),
88
+ )
89
+
90
+ yield* Effect.addFinalizer(
91
+ Effect.fn(
92
+ function* (exit) {
93
+ if (exit._tag === 'Failure' && Cause.isInterruptedOnly(exit.cause) === false) {
94
+ yield* Effect.logError('Closing wrangler dev server on failure', exit.cause)
95
+ }
96
+
97
+ yield* Effect.tryPromise(async () => {
98
+ await devServer.stop()
99
+ // TODO investigate whether we need to wait until exit (see workers-sdk repo/talk to Cloudflare team)
100
+ // await devServer.waitUntilExit()
101
+ })
102
+ },
103
+ Effect.timeout('5 seconds'),
104
+ Effect.orDie,
105
+ Effect.tapCauseLogPretty,
106
+ Effect.withSpan('WranglerDevServerService:stopDevServer'),
107
+ ),
108
+ )
109
+
110
+ const actualPort = devServer.port
111
+ const actualHost = devServer.address
112
+ const url = `http://${actualHost}:${actualPort}`
113
+
114
+ // Use longer timeout in CI environments to account for slower startup times
115
+ const defaultTimeout = Duration.seconds(IS_CI ? 30 : 5)
116
+
117
+ yield* verifyHttpConnectivity({ url, showLogs, connectTimeout: args.connectTimeout ?? defaultTimeout })
118
+
119
+ if (showLogs) {
120
+ yield* Effect.logDebug(
121
+ `Wrangler dev server ready and accepting connections on port ${actualPort} (preferred: ${preferredPort})`,
122
+ )
123
+ }
124
+
125
+ return {
126
+ port: actualPort,
127
+ url,
128
+ } satisfies WranglerDevServer
129
+ }).pipe(
130
+ Effect.mapError(
131
+ (error) =>
132
+ new WranglerDevServerError({ cause: error, message: 'Failed to start wrangler dev server', port: -1 }),
133
+ ),
134
+ Effect.withSpan('WranglerDevServerService', {
135
+ attributes: { preferredPort: args.preferredPort ?? 'auto', cwd: args.cwd },
136
+ }),
137
+ ),
138
+ }) {}
139
+
140
+ /**
141
+ * Verifies the server is actually accepting HTTP connections by making a test request
142
+ */
143
+ const verifyHttpConnectivity = ({
144
+ url,
145
+ showLogs,
146
+ connectTimeout,
147
+ }: {
148
+ url: string
149
+ showLogs: boolean
150
+ connectTimeout: Duration.DurationInput
151
+ }): Effect.Effect<void, WranglerDevServerError, HttpClient.HttpClient> =>
152
+ Effect.gen(function* () {
153
+ const client = yield* HttpClient.HttpClient
154
+
155
+ if (showLogs) {
156
+ yield* Effect.logDebug(`Verifying HTTP connectivity to ${url}`)
157
+ }
158
+
159
+ // Try to connect with retries using exponential backoff
160
+ yield* client.get(url).pipe(
161
+ Effect.retryOrElse(
162
+ Schedule.exponential('50 millis', 2).pipe(
163
+ Schedule.jittered,
164
+ Schedule.intersect(Schedule.elapsed.pipe(Schedule.whileOutput(Duration.lessThanOrEqualTo(connectTimeout)))),
165
+ Schedule.compose(Schedule.count),
166
+ ),
167
+ (error, attemptCount) =>
168
+ Effect.fail(
169
+ new WranglerDevServerError({
170
+ cause: error,
171
+ message: `Failed to establish HTTP connection to Wrangler server at ${url} after ${attemptCount} attempts (timeout: ${Duration.toMillis(connectTimeout)}ms)`,
172
+ port: 0,
173
+ }),
174
+ ),
175
+ ),
176
+ Effect.tap(() => (showLogs ? Effect.logDebug(`HTTP connectivity verified for ${url}`) : Effect.void)),
177
+ Effect.asVoid,
178
+ Effect.withSpan('verifyHttpConnectivity'),
179
+ )
180
+ })
@@ -0,0 +1,6 @@
1
+ export {
2
+ type StartWranglerDevServerArgs,
3
+ type WranglerDevServer,
4
+ WranglerDevServerError,
5
+ WranglerDevServerService,
6
+ } from './WranglerDevServer.ts'
@@ -1 +0,0 @@
1
- {"version":3,"file":"WranglerDevServer.d.ts","sourceRoot":"","sources":["../../../src/node/WranglerDevServer/WranglerDevServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,QAAQ,EACR,MAAM,EAEN,UAAU,EAGV,MAAM,EAEP,MAAM,yBAAyB,CAAA;;;;;;;;AAIhC;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,2BAI1C;CAAG;AAEL;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAA;CACxC;;4BAYgB,0BAA0B;;;;;;AAV3C;;;;;;;;GAQG;AACH,qBAAa,wBAAyB,SAAQ,6BA6I5C;CAAG"}
@@ -1,122 +0,0 @@
1
- import * as path from 'node:path';
2
- import { IS_CI } from '@livestore/utils';
3
- import { Command, Duration, Effect, Exit, HttpClient, Schedule, Schema, Stream, } from '@livestore/utils/effect';
4
- import { getFreePort } from '@livestore/utils/node';
5
- import { cleanupOrphanedProcesses, killProcessTree } from "./process-tree-manager.js";
6
- /**
7
- * Error type for WranglerDevServer operations
8
- */
9
- export class WranglerDevServerError extends Schema.TaggedError()('WranglerDevServerError', {
10
- cause: Schema.Unknown,
11
- message: Schema.String,
12
- port: Schema.Number,
13
- }) {
14
- }
15
- /**
16
- * WranglerDevServer as an Effect.Service.
17
- *
18
- * This service provides the WranglerDevServer properties and can be accessed
19
- * directly to get port, url, and processId.
20
- *
21
- * TODO: Allow for config to be passed in via code instead of `wrangler.toml` file
22
- * (would need to be placed in temporary file as wrangler only accepts files as config)
23
- */
24
- export class WranglerDevServerService extends Effect.Service()('WranglerDevServerService', {
25
- scoped: (args) => Effect.gen(function* () {
26
- const showLogs = args.showLogs ?? false;
27
- // Clean up any orphaned processes before starting (defensive cleanup)
28
- yield* cleanupOrphanedProcesses(['wrangler', 'workerd']).pipe(Effect.tap((result) => showLogs && (result.cleaned.length > 0 || result.failed.length > 0)
29
- ? Effect.logInfo(`Cleanup result: ${result.cleaned.length} cleaned, ${result.failed.length} failed`)
30
- : Effect.void), Effect.ignore);
31
- // Allocate port
32
- const port = args.port ??
33
- (yield* getFreePort.pipe(Effect.mapError((cause) => new WranglerDevServerError({ cause, message: 'Failed to get free port', port: -1 }))));
34
- yield* Effect.annotateCurrentSpan({ port });
35
- // Resolve config path
36
- const configPath = path.resolve(args.wranglerConfigPath ?? path.join(args.cwd, 'wrangler.toml'));
37
- // Start wrangler process using Effect Command
38
- const process = yield* Command.make('bunx', 'wrangler', 'dev', '--port', port.toString(), '--config', configPath).pipe(Command.workingDirectory(args.cwd), Command.stdout('pipe'), Command.stderr('pipe'), Command.start, Effect.catchAllCause((error) => new WranglerDevServerError({
39
- cause: error,
40
- message: `Failed to start wrangler process in directory: ${args.cwd}`,
41
- port,
42
- })), Effect.withSpan('WranglerDevServerService:startProcess'));
43
- if (showLogs) {
44
- yield* process.stderr.pipe(Stream.decodeText('utf8'), Stream.tapLogWithLabel('wrangler:stderr'), Stream.runDrain, Effect.forkScoped);
45
- }
46
- const processId = process.pid;
47
- // We need to keep the `stdout` stream open, as we drain it in the waitForReady function
48
- // Otherwise we'll get a EPIPE error
49
- const stdout = yield* Stream.broadcastDynamic(process.stdout, 100);
50
- // Register cleanup finalizer with intelligent timeout handling
51
- yield* Effect.addFinalizer((exit) => Effect.gen(function* () {
52
- const isInterrupted = Exit.isInterrupted(exit);
53
- if (showLogs) {
54
- yield* Effect.logDebug(`Cleaning up wrangler process ${processId}, interrupted: ${isInterrupted}`);
55
- }
56
- // yield* Effect.logDebug(`Cleaning up wrangler process ${processId}, interrupted: ${isInterrupted}`)
57
- // Check if process is still running
58
- const isRunning = yield* process.isRunning;
59
- if (isRunning) {
60
- // Use our enhanced process tree cleanup
61
- yield* killProcessTree(processId, {
62
- timeout: isInterrupted ? 500 : 3000, // Fast cleanup on interruption
63
- signals: ['SIGTERM', 'SIGKILL'],
64
- includeRoot: true,
65
- }).pipe(Effect.tap((result) => showLogs
66
- ? Effect.logDebug(`Cleaned up ${result.killedPids.length} processes, ${result.failedPids.length} failed`)
67
- : Effect.void), Effect.mapError((error) => new WranglerDevServerError({
68
- cause: error,
69
- message: `Failed to kill process tree for PID ${processId}`,
70
- port: 0,
71
- })), Effect.ignore);
72
- // Also kill the command process handle
73
- yield* process.kill();
74
- }
75
- else if (showLogs) {
76
- yield* Effect.logDebug(`Process ${processId} already terminated`);
77
- }
78
- }).pipe(Effect.withSpan('WranglerDevServerService:cleanupProcess'), Effect.timeout('5 seconds'), // Don't let cleanup hang forever
79
- Effect.ignoreLogged));
80
- // Wait for server to be ready
81
- yield* waitForReady({ stdout, showLogs });
82
- const url = `http://localhost:${port}`;
83
- // Use longer timeout in CI environments to account for slower startup times
84
- const defaultTimeout = Duration.seconds(IS_CI ? 15 : 5);
85
- yield* verifyHttpConnectivity({ url, showLogs, connectTimeout: args.connectTimeout ?? defaultTimeout });
86
- if (showLogs) {
87
- yield* Effect.logDebug(`Wrangler dev server ready and accepting connections on port ${port}`);
88
- }
89
- return {
90
- port,
91
- url,
92
- processId,
93
- };
94
- }).pipe(Effect.withSpan('WranglerDevServerService', {
95
- attributes: { port: args.port ?? 'auto', cwd: args.cwd },
96
- })),
97
- }) {
98
- }
99
- /**
100
- * Waits for Wrangler server to be ready by monitoring stdout for "Ready on" message
101
- */
102
- const waitForReady = ({ stdout, showLogs, }) => stdout.pipe(Stream.decodeText('utf8'), Stream.splitLines, Stream.tap((line) => (showLogs ? Effect.logDebug(`[wrangler] ${line}`) : Effect.void)), Stream.takeUntil((line) => line.includes('Ready on')), Stream.runDrain, Effect.timeout('30 seconds'), Effect.mapError((error) => new WranglerDevServerError({
103
- cause: error,
104
- message: 'Wrangler server failed to start within timeout',
105
- port: 0,
106
- })));
107
- /**
108
- * Verifies the server is actually accepting HTTP connections by making a test request
109
- */
110
- const verifyHttpConnectivity = ({ url, showLogs, connectTimeout, }) => Effect.gen(function* () {
111
- const client = yield* HttpClient.HttpClient;
112
- if (showLogs) {
113
- yield* Effect.logDebug(`Verifying HTTP connectivity to ${url}`);
114
- }
115
- // Try to connect with retries using exponential backoff
116
- yield* client.get(url).pipe(Effect.retryOrElse(Schedule.exponential('50 millis', 2).pipe(Schedule.jittered, Schedule.intersect(Schedule.elapsed.pipe(Schedule.whileOutput(Duration.lessThanOrEqualTo(connectTimeout)))), Schedule.compose(Schedule.count)), (error, attemptCount) => Effect.fail(new WranglerDevServerError({
117
- cause: error,
118
- message: `Failed to establish HTTP connection to Wrangler server at ${url} after ${attemptCount} attempts (timeout: ${Duration.toMillis(connectTimeout)}ms)`,
119
- port: 0,
120
- }))), Effect.tap(() => (showLogs ? Effect.logDebug(`HTTP connectivity verified for ${url}`) : Effect.void)), Effect.asVoid, Effect.withSpan('verifyHttpConnectivity'));
121
- });
122
- //# sourceMappingURL=WranglerDevServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WranglerDevServer.js","sourceRoot":"","sources":["../../../src/node/WranglerDevServer/WranglerDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,UAAU,EAEV,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAErF;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,MAAM,CAAC,WAAW,EAA0B,CAAC,wBAAwB,EAAE;IACjH,KAAK,EAAE,MAAM,CAAC,OAAO;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM;CACpB,CAAC;CAAG;AAuBL;;;;;;;;GAQG;AACH,MAAM,OAAO,wBAAyB,SAAQ,MAAM,CAAC,OAAO,EAA4B,CAAC,0BAA0B,EAAE;IACnH,MAAM,EAAE,CAAC,IAAgC,EAAE,EAAE,CAC3C,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAA;QAEvC,sEAAsE;QACtE,KAAK,CAAC,CAAC,wBAAwB,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAC3D,MAAM,CAAC,GAAG,CAAC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CAAC,CAAC,EACrG,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAC1C,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WranglerDevServer.test.d.ts","sourceRoot":"","sources":["../../../src/node/WranglerDevServer/WranglerDevServer.test.ts"],"names":[],"mappings":""}
@@ -1,179 +0,0 @@
1
- import { Effect, Exit, FetchHttpClient, Fiber, Layer, Scope } from '@livestore/utils/effect';
2
- import { PlatformNode } from '@livestore/utils/node';
3
- import { Vitest } from '@livestore/utils-dev/node-vitest';
4
- import { expect } from 'vitest';
5
- import { WranglerDevServerError, WranglerDevServerService, } from "./WranglerDevServer.js";
6
- const testTimeout = 60_000;
7
- const withTestCtx = Vitest.makeWithTestCtx({
8
- timeout: testTimeout,
9
- makeLayer: () => PlatformNode.NodeContext.layer,
10
- });
11
- const WranglerDevServerTest = (args = {}) => WranglerDevServerService.Default({
12
- cwd: `${import.meta.dirname}/fixtures`,
13
- ...args,
14
- }).pipe(Layer.provide(FetchHttpClient.layer));
15
- Vitest.describe('WranglerDevServer', { timeout: testTimeout }, () => {
16
- Vitest.describe('Basic Operations', () => {
17
- const withBasicTest = (args = {}) => Vitest.makeWithTestCtx({
18
- timeout: testTimeout,
19
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
20
- });
21
- Vitest.scopedLive('should start wrangler dev server and return port', (test) => Effect.gen(function* () {
22
- const server = yield* WranglerDevServerService;
23
- expect(server.port).toBeGreaterThan(0);
24
- expect(server.url).toMatch(/http:\/\/localhost:\d+/);
25
- expect(typeof server.processId).toBe('number');
26
- expect(server.processId).toBeGreaterThan(0);
27
- }).pipe(withBasicTest()(test)));
28
- Vitest.scopedLive('should use specified port when provided', (test) => Effect.gen(function* () {
29
- const server = yield* WranglerDevServerService;
30
- expect(server.port).toBe(54443);
31
- expect(server.url).toBe(`http://localhost:54443`);
32
- }).pipe(withBasicTest({ port: 54443 })(test)));
33
- });
34
- Vitest.describe('Resource Management', () => {
35
- Vitest.scopedLive('should cleanup processes on scope close', (test) => Effect.gen(function* () {
36
- let processId;
37
- // Create a separate scope for the server
38
- const serverScope = yield* Scope.make();
39
- const server = yield* Effect.provide(WranglerDevServerService, WranglerDevServerTest().pipe(Layer.provide(PlatformNode.NodeContext.layer))).pipe(Scope.extend(serverScope));
40
- processId = server.processId;
41
- expect(processId).toBeGreaterThan(0);
42
- expect(server.port).toBeGreaterThan(0);
43
- expect(server.url).toMatch(/http:\/\/localhost:\d+/);
44
- // Close scope to trigger cleanup
45
- yield* Scope.close(serverScope, Exit.succeed(void 0));
46
- // Wait for cleanup to complete
47
- yield* Effect.sleep('2 seconds');
48
- // Verify process is terminated
49
- const isRunning2 = yield* Effect.promise(() => {
50
- try {
51
- process.kill(processId, 0);
52
- return Promise.resolve(true);
53
- }
54
- catch {
55
- return Promise.resolve(false);
56
- }
57
- });
58
- expect(isRunning2).toBe(false);
59
- }).pipe(withTestCtx(test)));
60
- Vitest.scopedLive('should handle interruption with fast cleanup', (test) => Effect.gen(function* () {
61
- let processId;
62
- const fiber = yield* Effect.fork(Effect.provide(Effect.gen(function* () {
63
- const server = yield* WranglerDevServerService;
64
- processId = server.processId;
65
- yield* Effect.sleep('30 seconds'); // Keep running
66
- return server;
67
- }), WranglerDevServerTest().pipe(Layer.provide(PlatformNode.NodeContext.layer))));
68
- // Wait for server to start
69
- yield* Effect.sleep('3 seconds');
70
- expect(processId).toBeGreaterThan(0);
71
- // Interrupt and measure cleanup time
72
- const start = Date.now();
73
- yield* Fiber.interrupt(fiber);
74
- const elapsed = Date.now() - start;
75
- // Should use fast cleanup (500ms timeout) + some overhead
76
- expect(elapsed).toBeLessThan(1500); // Allow some overhead
77
- // Wait for cleanup to complete
78
- yield* Effect.sleep('1 second');
79
- // Verify process is terminated
80
- const isRunningAfter = yield* Effect.promise(() => {
81
- try {
82
- process.kill(processId, 0);
83
- return Promise.resolve(true);
84
- }
85
- catch {
86
- return Promise.resolve(false);
87
- }
88
- });
89
- expect(isRunningAfter).toBe(false);
90
- }).pipe(withTestCtx(test)));
91
- });
92
- Vitest.describe('Error Handling', () => {
93
- const withErrorTest = (args = {}) => Vitest.makeWithTestCtx({
94
- timeout: testTimeout,
95
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
96
- });
97
- Vitest.scopedLive('should handle missing wrangler.toml but should timeout', (test) => Effect.gen(function* () {
98
- const error = yield* WranglerDevServerService.pipe(Effect.provide(WranglerDevServerTest({
99
- cwd: '/tmp',
100
- wranglerConfigPath: '/dev/null',
101
- connectTimeout: '500 millis',
102
- }).pipe(Layer.provide(PlatformNode.NodeContext.layer))), Effect.flip);
103
- expect(error).toBeInstanceOf(WranglerDevServerError);
104
- }).pipe(Vitest.withTestCtx(test)));
105
- Vitest.scopedLive('should handle invalid working directory', (test) => Effect.gen(function* () {
106
- const result = yield* WranglerDevServerService.pipe(Effect.provide(WranglerDevServerTest({
107
- cwd: '/completely/nonexistent/directory',
108
- }).pipe(Layer.provide(PlatformNode.NodeContext.layer))), Effect.either);
109
- expect(result._tag).toBe('Left');
110
- if (result._tag === 'Left') {
111
- expect(result.left).toBeInstanceOf(WranglerDevServerError);
112
- }
113
- }).pipe(Vitest.withTestCtx(test)));
114
- Vitest.scopedLive('should timeout if server fails to start', (test) => Effect.gen(function* () {
115
- // Create a command that will never output "Ready on"
116
- const result = yield* WranglerDevServerService.pipe(
117
- // Override the timeout for this test to be shorter
118
- Effect.timeout('5 seconds'), Effect.either);
119
- // This might succeed or fail depending on actual wrangler behavior
120
- // The main point is testing timeout functionality
121
- expect(['Left', 'Right']).toContain(result._tag);
122
- }).pipe(withErrorTest()(test)));
123
- });
124
- Vitest.describe('Process Tree Cleanup', () => {
125
- const withCleanupTest = (args = {}) => Vitest.makeWithTestCtx({
126
- timeout: testTimeout,
127
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
128
- });
129
- Vitest.scopedLive('should clean up child workerd processes', (test) => Effect.gen(function* () {
130
- let processId;
131
- const server = yield* WranglerDevServerService;
132
- processId = server.processId;
133
- // Wait for wrangler to spawn workerd children
134
- yield* Effect.sleep('3 seconds');
135
- // Find any child processes (workerd)
136
- const children = yield* Effect.promise(async () => {
137
- const { exec } = require('node:child_process');
138
- const { promisify } = require('node:util');
139
- const execAsync = promisify(exec);
140
- try {
141
- if (!processId)
142
- throw new Error('processId is undefined');
143
- const { stdout } = await execAsync(`ps -o pid,ppid -ax | grep -E "^\\s*[0-9]+\\s+${processId}\\s*$"`);
144
- return stdout
145
- .trim()
146
- .split('\n')
147
- .map((line) => {
148
- const match = line.trim().match(/^\s*(\d+)\s+\d+\s*$/);
149
- return match?.[1] ? Number.parseInt(match[1], 10) : null;
150
- })
151
- .filter((pid) => pid !== null);
152
- }
153
- catch {
154
- return [];
155
- }
156
- });
157
- console.log(`Found ${children.length} child processes:`, children);
158
- // The scope will close here and should clean up all processes
159
- }).pipe(withCleanupTest()(test)));
160
- });
161
- Vitest.describe('Service Pattern', () => {
162
- const withServiceTest = (args = {}) => Vitest.makeWithTestCtx({
163
- timeout: testTimeout,
164
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
165
- });
166
- Vitest.scopedLive('should work with service pattern', (test) => Effect.gen(function* () {
167
- const server = yield* WranglerDevServerService;
168
- expect(server.port).toBeGreaterThan(0);
169
- expect(server.url).toMatch(/http:\/\/localhost:\d+/);
170
- expect(server.processId).toBeGreaterThan(0);
171
- }).pipe(withServiceTest()(test)));
172
- Vitest.scopedLive('should work with custom port via service', (test) => Effect.gen(function* () {
173
- const server = yield* WranglerDevServerService;
174
- expect(server.port).toBe(54444);
175
- expect(server.url).toBe('http://localhost:54444');
176
- }).pipe(withServiceTest({ port: 54444 })(test)));
177
- });
178
- });
179
- //# sourceMappingURL=WranglerDevServer.test.js.map
@@ -1 +0,0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AIC;AAED,qBAAa,MAAM;IACX,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;CAGlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cf-worker.js","sourceRoot":"","sources":["../../../../src/node/WranglerDevServer/fixtures/cf-worker.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,CAAC,KAAK,CAAC,QAAiB;QAC3B,OAAO,IAAI,QAAQ,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,MAAM,OAAO,MAAM;IACjB,KAAK,CAAC,KAAK,CAAC,QAAiB;QAC3B,OAAO,IAAI,QAAQ,CAAC,iCAAiC,CAAC,CAAA;IACxD,CAAC;CACF"}
@@ -1,55 +0,0 @@
1
- import { type CommandExecutor, Effect, Schema, type Scope } from '@livestore/utils/effect';
2
- declare const ProcessTreeError_base: Schema.TaggedErrorClass<ProcessTreeError, "ProcessTreeError", {
3
- readonly _tag: Schema.tag<"ProcessTreeError">;
4
- } & {
5
- cause: typeof Schema.Unknown;
6
- message: typeof Schema.String;
7
- pid: typeof Schema.Number;
8
- }>;
9
- export declare class ProcessTreeError extends ProcessTreeError_base {
10
- }
11
- /**
12
- * Finds all child processes of a given parent PID
13
- */
14
- export declare const findChildProcesses: (parentPid: number) => Effect.Effect<number[], never, CommandExecutor.CommandExecutor | Scope.Scope>;
15
- /**
16
- * Recursively finds all descendants of a process
17
- */
18
- export declare const findProcessTree: (rootPid: number) => Effect.Effect<number[], never, CommandExecutor.CommandExecutor | Scope.Scope>;
19
- /**
20
- * Checks if a process is running
21
- */
22
- export declare const isProcessRunning: (pid: number) => Effect.Effect<boolean, never, never>;
23
- /**
24
- * Kills a process tree with escalating signals
25
- */
26
- export declare const killProcessTree: (rootPid: number, options?: {
27
- timeout?: number;
28
- signals?: NodeJS.Signals[];
29
- includeRoot?: boolean;
30
- }) => Effect.Effect<{
31
- killedPids: number[];
32
- failedPids: number[];
33
- }, never, CommandExecutor.CommandExecutor | Scope.Scope>;
34
- /**
35
- * Finds orphaned processes by name pattern
36
- */
37
- export declare const findOrphanedProcesses: (namePattern: string) => Effect.Effect<number[], never, CommandExecutor.CommandExecutor | Scope.Scope>;
38
- /**
39
- * Defensive cleanup for orphaned processes matching given patterns.
40
- *
41
- * This function provides fallback cleanup for edge cases where normal process
42
- * termination mechanisms fail (e.g., hard crashes, SIGKILL before cleanup runs,
43
- * or limitations in synchronous exit handlers). While proper process tree cleanup
44
- * should prevent orphans in most cases, this serves as a safety net for scenarios
45
- * where child processes become orphaned despite cleanup efforts.
46
- *
47
- * @param processPatterns - Array of process name patterns to search for (e.g., ['wrangler', 'workerd'])
48
- * @returns Object with arrays of successfully cleaned and failed PIDs
49
- */
50
- export declare const cleanupOrphanedProcesses: (processPatterns: string[]) => Effect.Effect<{
51
- cleaned: number[];
52
- failed: number[];
53
- }, never, CommandExecutor.CommandExecutor | Scope.Scope>;
54
- export {};
55
- //# sourceMappingURL=process-tree-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-tree-manager.d.ts","sourceRoot":"","sources":["../../../src/node/WranglerDevServer/process-tree-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,KAAK,EAAU,MAAM,yBAAyB,CAAA;;;;;;;;AAE3G,qBAAa,gBAAiB,SAAQ,qBAIpC;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,KAChB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,eAAe,GAAG,KAAK,CAAC,KAAK,CA2B3E,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,KACd,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAe,CAAC,eAAe,GAAG,KAAK,CAAC,KAAK,CAkB3E,CAA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