Use ts-go for building our extensions

Also reverts to use experimental decorators due to stage 3 decorators not being supported yet https://github.com/microsoft/typescript-go/issues/2354

The skipLib check is needed to work around some jsdom types issues
This commit is contained in:
Matt Bierner
2026-02-02 20:02:55 -08:00
parent 424ef28d9b
commit cca17c1b7f
9 changed files with 168 additions and 48 deletions

View File

@@ -24,11 +24,14 @@ export class DisposableStore {
}
function decorate(decorator: (fn: Function, key: string) => Function): Function {
return function (original: any, context: ClassMethodDecoratorContext) {
if (context.kind === 'method' || context.kind === 'getter' || context.kind === 'setter') {
return decorator(original, context.name.toString());
return (_target: any, key: string, descriptor: PropertyDescriptor): void => {
if (typeof descriptor.value === 'function') {
descriptor.value = decorator(descriptor.value, key);
} else if (typeof descriptor.get === 'function') {
descriptor.get = decorator(descriptor.get, key) as () => any;
} else {
throw new Error('not supported');
}
throw new Error('not supported');
};
}