feat(runtime-adapters): Enable TypeScript decorator support for Deno and Bun runtimes and add decorator tests

This commit is contained in:
2025-11-17 01:21:20 +00:00
parent b94089652e
commit 16ca3b6374
8 changed files with 800 additions and 709 deletions

View File

@@ -31,8 +31,20 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
* Get default Deno options
*/
protected getDefaultOptions(): DenoOptions {
// Auto-detect deno.json or deno.jsonc config file for TypeScript decorator support
let configPath: string | undefined;
const denoJsonPath = plugins.path.join(process.cwd(), 'deno.json');
const denoJsoncPath = plugins.path.join(process.cwd(), 'deno.jsonc');
if (plugins.smartfile.fs.fileExistsSync(denoJsonPath)) {
configPath = denoJsonPath;
} else if (plugins.smartfile.fs.fileExistsSync(denoJsoncPath)) {
configPath = denoJsoncPath;
}
return {
...super.getDefaultOptions(),
configPath,
permissions: [
'--allow-read',
'--allow-env',