@livestore/utils-dev 0.0.0-snapshot-dffcd59e9628b35efd943619b722cf924c4ed98f → 0.0.0-snapshot-1c345a0e6695466bdc7c4483444e7b3513620261

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 (72) hide show
  1. package/dist/.tsbuildinfo.json +1 -1
  2. package/dist/node/mod.d.ts +13 -7
  3. package/dist/node/mod.d.ts.map +1 -1
  4. package/dist/node/mod.js +37 -22
  5. package/dist/node/mod.js.map +1 -1
  6. package/dist/node-vitest/mod.d.ts +1 -2
  7. package/dist/node-vitest/mod.d.ts.map +1 -1
  8. package/dist/node-vitest/mod.js +1 -2
  9. package/dist/node-vitest/mod.js.map +1 -1
  10. package/dist/node-vitest/polyfill.d.ts +2 -0
  11. package/dist/node-vitest/polyfill.d.ts.map +1 -0
  12. package/dist/node-vitest/{global.js → polyfill.js} +1 -1
  13. package/dist/node-vitest/polyfill.js.map +1 -0
  14. package/package.json +23 -16
  15. package/src/node/mod.ts +77 -39
  16. package/src/node-vitest/mod.ts +1 -3
  17. package/dist/node/DockerComposeService/DockerComposeService.d.ts +0 -48
  18. package/dist/node/DockerComposeService/DockerComposeService.d.ts.map +0 -1
  19. package/dist/node/DockerComposeService/DockerComposeService.js +0 -107
  20. package/dist/node/DockerComposeService/DockerComposeService.js.map +0 -1
  21. package/dist/node/DockerComposeService/DockerComposeService.test.d.ts +0 -2
  22. package/dist/node/DockerComposeService/DockerComposeService.test.d.ts.map +0 -1
  23. package/dist/node/DockerComposeService/DockerComposeService.test.js +0 -64
  24. package/dist/node/DockerComposeService/DockerComposeService.test.js.map +0 -1
  25. package/dist/node/FileLogger.d.ts +0 -14
  26. package/dist/node/FileLogger.d.ts.map +0 -1
  27. package/dist/node/FileLogger.js +0 -151
  28. package/dist/node/FileLogger.js.map +0 -1
  29. package/dist/node/WranglerDevServer/WranglerDevServer.d.ts +0 -53
  30. package/dist/node/WranglerDevServer/WranglerDevServer.d.ts.map +0 -1
  31. package/dist/node/WranglerDevServer/WranglerDevServer.js +0 -113
  32. package/dist/node/WranglerDevServer/WranglerDevServer.js.map +0 -1
  33. package/dist/node/WranglerDevServer/WranglerDevServer.test.d.ts +0 -2
  34. package/dist/node/WranglerDevServer/WranglerDevServer.test.d.ts.map +0 -1
  35. package/dist/node/WranglerDevServer/WranglerDevServer.test.js +0 -186
  36. package/dist/node/WranglerDevServer/WranglerDevServer.test.js.map +0 -1
  37. package/dist/node/WranglerDevServer/fixtures/cf-worker.d.ts +0 -8
  38. package/dist/node/WranglerDevServer/fixtures/cf-worker.d.ts.map +0 -1
  39. package/dist/node/WranglerDevServer/fixtures/cf-worker.js +0 -11
  40. package/dist/node/WranglerDevServer/fixtures/cf-worker.js.map +0 -1
  41. package/dist/node/WranglerDevServer/process-tree-manager.d.ts +0 -55
  42. package/dist/node/WranglerDevServer/process-tree-manager.d.ts.map +0 -1
  43. package/dist/node/WranglerDevServer/process-tree-manager.js +0 -178
  44. package/dist/node/WranglerDevServer/process-tree-manager.js.map +0 -1
  45. package/dist/node/cmd.d.ts +0 -27
  46. package/dist/node/cmd.d.ts.map +0 -1
  47. package/dist/node/cmd.js +0 -55
  48. package/dist/node/cmd.js.map +0 -1
  49. package/dist/node-vitest/Vitest.d.ts +0 -52
  50. package/dist/node-vitest/Vitest.d.ts.map +0 -1
  51. package/dist/node-vitest/Vitest.js +0 -98
  52. package/dist/node-vitest/Vitest.js.map +0 -1
  53. package/dist/node-vitest/Vitest.test.d.ts +0 -2
  54. package/dist/node-vitest/Vitest.test.d.ts.map +0 -1
  55. package/dist/node-vitest/Vitest.test.js +0 -59
  56. package/dist/node-vitest/Vitest.test.js.map +0 -1
  57. package/dist/node-vitest/global.d.ts +0 -2
  58. package/dist/node-vitest/global.d.ts.map +0 -1
  59. package/dist/node-vitest/global.js.map +0 -1
  60. package/src/node/DockerComposeService/DockerComposeService.test.ts +0 -91
  61. package/src/node/DockerComposeService/DockerComposeService.ts +0 -252
  62. package/src/node/DockerComposeService/test-fixtures/docker-compose.yml +0 -4
  63. package/src/node/FileLogger.ts +0 -206
  64. package/src/node/WranglerDevServer/WranglerDevServer.test.ts +0 -268
  65. package/src/node/WranglerDevServer/WranglerDevServer.ts +0 -220
  66. package/src/node/WranglerDevServer/fixtures/cf-worker.ts +0 -11
  67. package/src/node/WranglerDevServer/fixtures/wrangler.toml +0 -11
  68. package/src/node/WranglerDevServer/process-tree-manager.ts +0 -263
  69. package/src/node/cmd.ts +0 -99
  70. package/src/node-vitest/Vitest.test.ts +0 -101
  71. package/src/node-vitest/Vitest.ts +0 -221
  72. /package/src/node-vitest/{global.ts → polyfill.ts} +0 -0
@@ -1,268 +0,0 @@
1
- import { Effect, Exit, 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 {
6
- type StartWranglerDevServerArgs,
7
- WranglerDevServerError,
8
- WranglerDevServerService,
9
- } from './WranglerDevServer.ts'
10
-
11
- const testTimeout = 60_000
12
-
13
- const withTestCtx = Vitest.makeWithTestCtx({
14
- timeout: testTimeout,
15
- makeLayer: () => PlatformNode.NodeContext.layer,
16
- })
17
-
18
- const WranglerDevServerTest = (args: Partial<StartWranglerDevServerArgs> = {}) =>
19
- WranglerDevServerService.Default({
20
- cwd: `${import.meta.dirname}/fixtures`,
21
- ...args,
22
- })
23
-
24
- Vitest.describe('WranglerDevServer', { timeout: testTimeout }, () => {
25
- Vitest.describe('Basic Operations', () => {
26
- const withBasicTest = (args: Partial<StartWranglerDevServerArgs> = {}) =>
27
- Vitest.makeWithTestCtx({
28
- timeout: testTimeout,
29
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
30
- })
31
-
32
- Vitest.scopedLive('should start wrangler dev server and return port', (test) =>
33
- Effect.gen(function* () {
34
- const server = yield* WranglerDevServerService
35
-
36
- expect(server.port).toBeGreaterThan(0)
37
- expect(server.url).toMatch(/http:\/\/localhost:\d+/)
38
- expect(typeof server.processId).toBe('number')
39
- expect(server.processId).toBeGreaterThan(0)
40
- }).pipe(withBasicTest()(test)),
41
- )
42
-
43
- Vitest.scopedLive('should use specified port when provided', (test) =>
44
- Effect.gen(function* () {
45
- const server = yield* WranglerDevServerService
46
-
47
- expect(server.port).toBe(54443)
48
- expect(server.url).toBe(`http://localhost:54443`)
49
- }).pipe(withBasicTest({ port: 54443 })(test)),
50
- )
51
- })
52
-
53
- Vitest.describe('Resource Management', () => {
54
- Vitest.scopedLive('should cleanup processes on scope close', (test) =>
55
- Effect.gen(function* () {
56
- let processId: number | undefined
57
-
58
- // Create a separate scope for the server
59
- const serverScope = yield* Scope.make()
60
-
61
- const server = yield* Effect.provide(
62
- WranglerDevServerService,
63
- WranglerDevServerTest().pipe(Layer.provide(PlatformNode.NodeContext.layer)),
64
- ).pipe(Scope.extend(serverScope))
65
-
66
- processId = server.processId
67
- expect(processId).toBeGreaterThan(0)
68
- expect(server.port).toBeGreaterThan(0)
69
- expect(server.url).toMatch(/http:\/\/localhost:\d+/)
70
-
71
- // Close scope to trigger cleanup
72
- yield* Scope.close(serverScope, Exit.succeed(void 0))
73
-
74
- // Wait for cleanup to complete
75
- yield* Effect.sleep('2 seconds')
76
-
77
- // Verify process is terminated
78
- const isRunning2 = yield* Effect.promise(() => {
79
- try {
80
- process.kill(processId!, 0)
81
- return Promise.resolve(true)
82
- } catch {
83
- return Promise.resolve(false)
84
- }
85
- })
86
- expect(isRunning2).toBe(false)
87
- }).pipe(withTestCtx(test)),
88
- )
89
-
90
- Vitest.scopedLive('should handle interruption with fast cleanup', (test) =>
91
- Effect.gen(function* () {
92
- let processId: number | undefined
93
-
94
- const fiber = yield* Effect.fork(
95
- Effect.provide(
96
- Effect.gen(function* () {
97
- const server = yield* WranglerDevServerService
98
- processId = server.processId
99
- yield* Effect.sleep('30 seconds') // Keep running
100
- return server
101
- }),
102
- WranglerDevServerTest().pipe(Layer.provide(PlatformNode.NodeContext.layer)),
103
- ),
104
- )
105
-
106
- // Wait for server to start
107
- yield* Effect.sleep('3 seconds')
108
-
109
- expect(processId).toBeGreaterThan(0)
110
-
111
- // Interrupt and measure cleanup time
112
- const start = Date.now()
113
- yield* Fiber.interrupt(fiber)
114
- const elapsed = Date.now() - start
115
-
116
- // Should use fast cleanup (500ms timeout) + some overhead
117
- expect(elapsed).toBeLessThan(1500) // Allow some overhead
118
-
119
- // Wait for cleanup to complete
120
- yield* Effect.sleep('1 second')
121
-
122
- // Verify process is terminated
123
- const isRunningAfter = yield* Effect.promise(() => {
124
- try {
125
- process.kill(processId!, 0)
126
- return Promise.resolve(true)
127
- } catch {
128
- return Promise.resolve(false)
129
- }
130
- })
131
- expect(isRunningAfter).toBe(false)
132
- }).pipe(withTestCtx(test)),
133
- )
134
- })
135
-
136
- Vitest.describe('Error Handling', () => {
137
- const withErrorTest = (args: Partial<StartWranglerDevServerArgs> = {}) =>
138
- Vitest.makeWithTestCtx({
139
- timeout: testTimeout,
140
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
141
- })
142
-
143
- Vitest.scopedLive('should handle missing wrangler.toml', (test) =>
144
- Effect.gen(function* () {
145
- // Since Wrangler can work without a config file, let's test with a truly invalid scenario
146
- const result = yield* WranglerDevServerService.pipe(Effect.either)
147
-
148
- // Note: Wrangler might still succeed even with /dev/null, so this test
149
- // verifies our implementation handles the case properly, whether it succeeds or fails
150
- expect(['Left', 'Right']).toContain(result._tag)
151
-
152
- if (result._tag === 'Left') {
153
- // If it fails, it should be a wrapped error
154
- expect(result.left).toBeInstanceOf(WranglerDevServerError)
155
- } else {
156
- // If it succeeds, the server should be properly configured
157
- expect(result.right.port).toBeGreaterThan(0)
158
- }
159
- }).pipe(withErrorTest({ cwd: '/tmp', wranglerConfigPath: '/dev/null' })(test)),
160
- )
161
-
162
- Vitest.scopedLive('should handle invalid working directory', (test) =>
163
- Effect.gen(function* () {
164
- const result = yield* WranglerDevServerService.pipe(
165
- Effect.provide(
166
- WranglerDevServerTest({
167
- cwd: '/completely/nonexistent/directory',
168
- }).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
169
- ),
170
- Effect.either,
171
- )
172
-
173
- expect(result._tag).toBe('Left')
174
- if (result._tag === 'Left') {
175
- expect(result.left).toBeInstanceOf(WranglerDevServerError)
176
- }
177
- }).pipe(Vitest.withTestCtx(test)),
178
- )
179
-
180
- Vitest.scopedLive('should timeout if server fails to start', (test) =>
181
- Effect.gen(function* () {
182
- // Create a command that will never output "Ready on"
183
- const result = yield* WranglerDevServerService.pipe(
184
- // Override the timeout for this test to be shorter
185
- Effect.timeout('5 seconds'),
186
- Effect.either,
187
- )
188
-
189
- // This might succeed or fail depending on actual wrangler behavior
190
- // The main point is testing timeout functionality
191
- expect(['Left', 'Right']).toContain(result._tag)
192
- }).pipe(withErrorTest()(test)),
193
- )
194
- })
195
-
196
- Vitest.describe('Process Tree Cleanup', () => {
197
- const withCleanupTest = (args: Partial<StartWranglerDevServerArgs> = {}) =>
198
- Vitest.makeWithTestCtx({
199
- timeout: testTimeout,
200
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
201
- })
202
-
203
- Vitest.scopedLive('should clean up child workerd processes', (test) =>
204
- Effect.gen(function* () {
205
- let processId: number | undefined
206
-
207
- const server = yield* WranglerDevServerService
208
- processId = server.processId
209
-
210
- // Wait for wrangler to spawn workerd children
211
- yield* Effect.sleep('3 seconds')
212
-
213
- // Find any child processes (workerd)
214
- const children = yield* Effect.promise(async () => {
215
- const { exec } = require('node:child_process')
216
- const { promisify } = require('node:util')
217
- const execAsync = promisify(exec)
218
-
219
- try {
220
- if (!processId) throw new Error('processId is undefined')
221
- const { stdout } = await execAsync(`ps -o pid,ppid -ax | grep -E "^\\s*[0-9]+\\s+${processId}\\s*$"`)
222
- return stdout
223
- .trim()
224
- .split('\n')
225
- .map((line: string) => {
226
- const match = line.trim().match(/^\s*(\d+)\s+\d+\s*$/)
227
- return match?.[1] ? Number.parseInt(match[1], 10) : null
228
- })
229
- .filter((pid: number | null): pid is number => pid !== null)
230
- } catch {
231
- return []
232
- }
233
- })
234
-
235
- console.log(`Found ${children.length} child processes:`, children)
236
-
237
- // The scope will close here and should clean up all processes
238
- }).pipe(withCleanupTest()(test)),
239
- )
240
- })
241
-
242
- Vitest.describe('Service Pattern', () => {
243
- const withServiceTest = (args: Partial<StartWranglerDevServerArgs> = {}) =>
244
- Vitest.makeWithTestCtx({
245
- timeout: testTimeout,
246
- makeLayer: () => WranglerDevServerTest(args).pipe(Layer.provide(PlatformNode.NodeContext.layer)),
247
- })
248
-
249
- Vitest.scopedLive('should work with service pattern', (test) =>
250
- Effect.gen(function* () {
251
- const server = yield* WranglerDevServerService
252
-
253
- expect(server.port).toBeGreaterThan(0)
254
- expect(server.url).toMatch(/http:\/\/localhost:\d+/)
255
- expect(server.processId).toBeGreaterThan(0)
256
- }).pipe(withServiceTest()(test)),
257
- )
258
-
259
- Vitest.scopedLive('should work with custom port via service', (test) =>
260
- Effect.gen(function* () {
261
- const server = yield* WranglerDevServerService
262
-
263
- expect(server.port).toBe(54444)
264
- expect(server.url).toBe('http://localhost:54444')
265
- }).pipe(withServiceTest({ port: 54444 })(test)),
266
- )
267
- })
268
- })
@@ -1,220 +0,0 @@
1
- import * as path from 'node:path'
2
-
3
- import { Command, Effect, Exit, type PlatformError, Schema, Stream } from '@livestore/utils/effect'
4
- import { getFreePort } from '@livestore/utils/node'
5
- import { cleanupOrphanedProcesses, killProcessTree } from './process-tree-manager.ts'
6
-
7
- /**
8
- * Error type for WranglerDevServer operations
9
- */
10
- export class WranglerDevServerError extends Schema.TaggedError<WranglerDevServerError>()('WranglerDevServerError', {
11
- cause: Schema.Unknown,
12
- message: Schema.String,
13
- port: Schema.Number,
14
- }) {}
15
-
16
- /**
17
- * WranglerDevServer instance interface
18
- */
19
- export interface WranglerDevServer {
20
- readonly port: number
21
- readonly url: string
22
- readonly processId: number
23
- }
24
-
25
- /**
26
- * Configuration for starting WranglerDevServer
27
- */
28
- export interface StartWranglerDevServerArgs {
29
- wranglerConfigPath?: string
30
- cwd: string
31
- port?: number
32
- /** Inspector/debugger port for workerd. If not specified, uses a random free port */
33
- inspectorPort?: number
34
- /** @default false */
35
- showLogs?: boolean
36
- }
37
-
38
- /**
39
- * WranglerDevServer as an Effect.Service.
40
- *
41
- * This service provides the WranglerDevServer properties and can be accessed
42
- * directly to get port, url, and processId.
43
- *
44
- * TODO: Allow for config to be passed in via code instead of `wrangler.toml` file
45
- * (would need to be placed in temporary file as wrangler only accepts files as config)
46
- */
47
- export class WranglerDevServerService extends Effect.Service<WranglerDevServerService>()('WranglerDevServerService', {
48
- scoped: (args: StartWranglerDevServerArgs) =>
49
- Effect.gen(function* () {
50
- const showLogs = args.showLogs ?? false
51
-
52
- // Clean up any orphaned processes before starting (defensive cleanup)
53
- yield* cleanupOrphanedProcesses(['wrangler', 'workerd']).pipe(
54
- Effect.tap((result) =>
55
- showLogs && (result.cleaned.length > 0 || result.failed.length > 0)
56
- ? Effect.logInfo(`Cleanup result: ${result.cleaned.length} cleaned, ${result.failed.length} failed`)
57
- : Effect.void,
58
- ),
59
- Effect.ignore, // Don't fail startup if cleanup fails
60
- )
61
-
62
- // Allocate port
63
- const port =
64
- args.port ??
65
- (yield* getFreePort.pipe(
66
- Effect.mapError(
67
- (cause) => new WranglerDevServerError({ cause, message: 'Failed to get free port', port: -1 }),
68
- ),
69
- ))
70
-
71
- // Allocate inspector port if not provided
72
- const inspectorPort =
73
- args.inspectorPort ??
74
- (yield* getFreePort.pipe(
75
- Effect.mapError(
76
- (cause) => new WranglerDevServerError({ cause, message: 'Failed to get free inspector port', port: -1 }),
77
- ),
78
- ))
79
-
80
- yield* Effect.annotateCurrentSpan({ port, inspectorPort })
81
-
82
- // Resolve config path
83
- const configPath = path.resolve(args.wranglerConfigPath ?? path.join(args.cwd, 'wrangler.toml'))
84
-
85
- // Start wrangler process using Effect Command
86
- // In CI, disable the inspector to avoid port conflicts
87
- const commandArgs: string[] = ['bunx', 'wrangler', 'dev', '--port', port.toString()]
88
-
89
- // Only add inspector port if not in CI to avoid conflicts
90
- // Use global process from Node.js
91
- if (!global.process.env.CI) {
92
- commandArgs.push('--inspector-port', inspectorPort.toString())
93
- }
94
-
95
- commandArgs.push('--config', configPath)
96
-
97
- const process = yield* Command.make(...commandArgs as [string, ...string[]]).pipe(
98
- Command.workingDirectory(args.cwd),
99
- Command.stdout('pipe'),
100
- Command.stderr('pipe'),
101
- Command.start,
102
- Effect.catchAllCause(
103
- (error) =>
104
- new WranglerDevServerError({
105
- cause: error,
106
- message: `Failed to start wrangler process in directory: ${args.cwd}`,
107
- port,
108
- }),
109
- ),
110
- Effect.withSpan('WranglerDevServerService:startProcess'),
111
- )
112
-
113
- if (showLogs) {
114
- yield* process.stderr.pipe(
115
- Stream.decodeText('utf8'),
116
- Stream.tapLogWithLabel('wrangler:stderr'),
117
- Stream.runDrain,
118
- Effect.forkScoped,
119
- )
120
- }
121
-
122
- const processId = process.pid
123
-
124
- // We need to keep the `stdout` stream open, as we drain it in the waitForReady function
125
- // Otherwise we'll get a EPIPE error
126
- const stdout = yield* Stream.broadcastDynamic(process.stdout, 100)
127
-
128
- // Register cleanup finalizer with intelligent timeout handling
129
- yield* Effect.addFinalizer((exit) =>
130
- Effect.gen(function* () {
131
- const isInterrupted = Exit.isInterrupted(exit)
132
- if (showLogs) {
133
- yield* Effect.logDebug(`Cleaning up wrangler process ${processId}, interrupted: ${isInterrupted}`)
134
- }
135
- // yield* Effect.logDebug(`Cleaning up wrangler process ${processId}, interrupted: ${isInterrupted}`)
136
-
137
- // Check if process is still running
138
- const isRunning = yield* process.isRunning
139
-
140
- if (isRunning) {
141
- // Use our enhanced process tree cleanup
142
- yield* killProcessTree(processId, {
143
- timeout: isInterrupted ? 500 : 3000, // Fast cleanup on interruption
144
- signals: ['SIGTERM', 'SIGKILL'],
145
- includeRoot: true,
146
- }).pipe(
147
- Effect.tap((result) =>
148
- showLogs
149
- ? Effect.logDebug(
150
- `Cleaned up ${result.killedPids.length} processes, ${result.failedPids.length} failed`,
151
- )
152
- : Effect.void,
153
- ),
154
- Effect.mapError(
155
- (error) =>
156
- new WranglerDevServerError({
157
- cause: error,
158
- message: `Failed to kill process tree for PID ${processId}`,
159
- port: 0,
160
- }),
161
- ),
162
- Effect.ignore, // Don't fail the finalizer if cleanup has issues
163
- )
164
-
165
- // Also kill the command process handle
166
- yield* process.kill()
167
- } else if (showLogs) {
168
- yield* Effect.logDebug(`Process ${processId} already terminated`)
169
- }
170
- }).pipe(
171
- Effect.timeout('5 seconds'), // Don't let cleanup hang forever
172
- Effect.ignoreLogged,
173
- ),
174
- )
175
-
176
- // Wait for server to be ready
177
- yield* waitForReady({ stdout, showLogs })
178
-
179
- if (showLogs) {
180
- yield* Effect.logDebug(`Wrangler dev server ready on port ${port}`)
181
- }
182
-
183
- return {
184
- port,
185
- url: `http://localhost:${port}`,
186
- processId,
187
- } satisfies WranglerDevServer
188
- }).pipe(
189
- Effect.withSpan('WranglerDevServerService', {
190
- attributes: { port: args.port ?? 'auto', cwd: args.cwd },
191
- }),
192
- ),
193
- }) {}
194
-
195
- /**
196
- * Waits for Wrangler server to be ready by monitoring stdout for "Ready on" message
197
- */
198
- const waitForReady = ({
199
- stdout,
200
- showLogs,
201
- }: {
202
- stdout: Stream.Stream<Uint8Array, PlatformError.PlatformError, never>
203
- showLogs: boolean
204
- }): Effect.Effect<void, WranglerDevServerError, never> =>
205
- stdout.pipe(
206
- Stream.decodeText('utf8'),
207
- Stream.splitLines,
208
- Stream.tap((line) => (showLogs ? Effect.logDebug(`[wrangler] ${line}`) : Effect.void)),
209
- Stream.takeUntil((line) => line.includes('Ready on')),
210
- Stream.runDrain,
211
- Effect.timeout('30 seconds'),
212
- Effect.mapError(
213
- (error) =>
214
- new WranglerDevServerError({
215
- cause: error,
216
- message: 'Wrangler server failed to start within timeout',
217
- port: 0,
218
- }),
219
- ),
220
- )
@@ -1,11 +0,0 @@
1
- export default {
2
- async fetch(_request: Request): Promise<Response> {
3
- return new Response('Hello from Wrangler Dev Server test worker!')
4
- },
5
- }
6
-
7
- export class TestDO {
8
- async fetch(_request: Request): Promise<Response> {
9
- return new Response('Hello from Test Durable Object!')
10
- }
11
- }
@@ -1,11 +0,0 @@
1
- name = "wrangler-dev-server-test"
2
- main = "./cf-worker.ts"
3
- compatibility_date = "2024-05-12"
4
-
5
- [[durable_objects.bindings]]
6
- name = "TEST_DO"
7
- class_name = "TestDO"
8
-
9
- [[migrations]]
10
- tag = "v1"
11
- new_sqlite_classes = ["TestDO"]