Replace typescript compiler with native tsgo compiler

This commit is contained in:
Jamie
2026-03-18 11:26:18 -07:00
committed by GitHub
parent 5e6af4708b
commit c90ca2b4e0
207 changed files with 1819 additions and 1270 deletions

View File

@@ -14,7 +14,8 @@ import { createLogger } from '../../logging/log.std.js';
const logger = createLogger('uploadDebugLogs_test');
const gzip: (_: zlib.InputType) => Promise<Buffer> = util.promisify(zlib.gzip);
const gzip: (_: zlib.InputType) => Promise<Buffer<ArrayBuffer>> =
util.promisify(zlib.gzip);
describe('upload', () => {
beforeEach(function (this: Mocha.Context) {

View File

@@ -47,7 +47,10 @@ export function updateToVersion(db: WritableDB, version: number): void {
}
type TableRows = ReadonlyArray<
Record<string, string | number | Buffer | null | Record<string, unknown>>
Record<
string,
string | number | Buffer<ArrayBuffer> | null | Record<string, unknown>
>
>;
export function insertData(

View File

@@ -2457,7 +2457,7 @@ describe('SQL migrations test', () => {
const payload = db.prepare('SELECT * FROM sendLogPayloads LIMIT 1;').get<{
contentHint: number;
timestamp: number;
proto: Uint8Array;
proto: Uint8Array<ArrayBuffer>;
urgent: number;
}>();

View File

@@ -446,7 +446,9 @@ describe('Attachment', () => {
};
const expectedAttachmentData = Bytes.fromString('Above us only sky');
const writeNewAttachmentData = async (attachmentData: Uint8Array) => {
const writeNewAttachmentData = async (
attachmentData: Uint8Array<ArrayBuffer>
) => {
assert.deepEqual(attachmentData, expectedAttachmentData);
return FAKE_LOCAL_ATTACHMENT;
};

View File

@@ -75,7 +75,7 @@ describe('Message', () => {
logger: LoggerType;
}) => new Blob(),
makeObjectUrl: (
_data: Uint8Array | ArrayBuffer,
_data: Uint8Array<ArrayBuffer> | ArrayBuffer,
_contentType: MIME.MIMEType
) => 'fake-object-url',
makeVideoScreenshot: async (_params: {
@@ -86,14 +86,14 @@ describe('Message', () => {
revokeObjectUrl: (_objectUrl: string) => undefined,
readAttachmentData: async (
attachment: Partial<AddressableAttachmentType>
): Promise<Uint8Array> => {
): Promise<Uint8Array<ArrayBuffer>> => {
assert.strictEqual(attachment.version, 2);
return Buffer.from('old data');
},
writeNewAttachmentData: async (_data: Uint8Array) => {
writeNewAttachmentData: async (_data: Uint8Array<ArrayBuffer>) => {
return FAKE_LOCAL_ATTACHMENT;
},
writeNewStickerData: async (_data: Uint8Array) => ({
writeNewStickerData: async (_data: Uint8Array<ArrayBuffer>) => ({
version: 2,
path: 'fake-sticker-path',
size: 1,

View File

@@ -19,7 +19,7 @@ describe('DelimitedStream', () => {
}
async function strideTest(
data: Uint8Array,
data: Uint8Array<ArrayBuffer>,
result: ReadonlyArray<string>
): Promise<void> {
// Just to keep reasonable run times

View File

@@ -23,7 +23,7 @@ describe('appendMacStream', () => {
const stream = appendMacStream(macKey);
stream.end(plaintext);
const chunks = new Array<Buffer>();
const chunks = new Array<Buffer<ArrayBuffer>>();
for await (const chunk of stream) {
chunks.push(chunk);
}

View File

@@ -10,7 +10,7 @@ describe('prependStream', () => {
const stream = prependStream(Buffer.from('prefix:'));
stream.end('hello');
const chunks = new Array<Buffer>();
const chunks = new Array<Buffer<ArrayBuffer>>();
for await (const chunk of stream) {
chunks.push(chunk);
}

View File

@@ -16,7 +16,7 @@ import {
import { sniffImageMimeType } from '../../util/sniffImageMimeType.std.js';
describe('sniffImageMimeType', () => {
const fixture = (filename: string): Promise<Buffer> => {
const fixture = (filename: string): Promise<Buffer<ArrayBuffer>> => {
const fixturePath = path.join(
__dirname,
'..',

View File

@@ -20,13 +20,14 @@ export type LastRequestData = Readonly<{
method?: string;
url?: string;
headers: OutgoingHttpHeaders;
body: Buffer;
body: Buffer<ArrayBuffer>;
}>;
export class TestServer extends EventEmitter {
#server: Server;
#nextResponse: NextResponse = { status: 200, headers: {} };
#lastRequest: { request: IncomingMessage; body: Buffer } | null = null;
#lastRequest: { request: IncomingMessage; body: Buffer<ArrayBuffer> } | null =
null;
constructor() {
super();
@@ -107,7 +108,7 @@ export class TestServer extends EventEmitter {
export function body(
server: TestServer,
steps: () => AsyncIterator<Uint8Array, void, number>
steps: () => AsyncIterator<Uint8Array<ArrayBuffer>, void, number>
): Readable {
const iter = steps();
let first = true;