Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/meta/src/node-es-module-loader/loader.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface TsConfig {
}

// Read and parse tsconfig.base.json
const workspaceRoot = join(import.meta.dirname, '..', '..', '..', '..')
const workspaceRoot = join(import.meta.dirname, '..', '..', '..', '..');
const tsconfigPath = join(workspaceRoot, 'tsconfig.base.json');
const tsconfig: TsConfig = JSON.parse(readFileSync(tsconfigPath, 'utf-8'));
const pathAliases = tsconfig.compilerOptions.paths;
Expand Down
16 changes: 14 additions & 2 deletions packages/php-wasm/universal/src/lib/php-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,23 @@ export class PHPWorker implements LimitedPHPApi, AsyncDisposable {
options?: { env?: Record<string, string> }
): Promise<StreamedPHPResponse> {
const { php, reap } = await this.acquirePHPInstance();
let response: StreamedPHPResponse;
try {
return await php.cli(argv, options);
} finally {
response = await php.cli(argv, options);
} catch (error) {
reap();
throw error;
}
/**
* Register the reap() callback to run asynchronously once
* the response is finished.
*
* We don't await for response.finished here. It is a
* `StreamedPHPResponse` instance and the caller may want
* to start processing the streamed data immediately.
*/
response.finished.finally(reap);
return response;
}

/** @inheritDoc @php-wasm/universal!/PHP.chdir */
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/cli/tests/run-cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,5 +631,5 @@ describe.each(blueprintVersions)(
});
});
},
60000
60_000 * 5
);