vendor: support native TypeScript source loading

This commit is contained in:
imccyu
2026-07-28 23:03:23 +08:00
parent eb38a365dc
commit 5ea161fa68
23 changed files with 77 additions and 72 deletions

View File

@@ -1,5 +1,5 @@
import { Context, Service } from 'cordis'
import { Entry, EntryOptions } from './entry.ts'
import { Entry, type EntryOptions } from './entry.ts'
import { EntryTree } from './tree.ts'
/** Runtime owner for a list of child loader entries. */

View File

@@ -1,5 +1,5 @@
import { Context } from 'cordis'
import { Dict } from 'cosmokit'
import type { Dict } from 'cosmokit'
import { Entry } from './entry.ts'
declare module './entry.ts' {

View File

@@ -1,6 +1,6 @@
import { composeError, Context } from 'cordis'
import { Dict, isNonNullable } from 'cosmokit'
import { Entry, EntryOptions } from './entry.ts'
import { isNonNullable, type Dict } from 'cosmokit'
import { Entry, type EntryOptions } from './entry.ts'
import { EntryGroup } from './group.ts'
/** Mutable tree of loader entries. Persistence is supplied by subclasses. */

View File

@@ -1,7 +1,7 @@
import { Context, Inject, Service } from 'cordis'
import { defineProperty, Dict, isNullable } from 'cosmokit'
import { defineProperty, isNullable, type Dict } from 'cosmokit'
import { ModuleLoader } from './internal.ts'
import { Entry, EntryOptions } from './config/entry.ts'
import { Entry, type EntryOptions } from './config/entry.ts'
import isolate from './config/isolate.ts'
import { EntryTree } from './config/tree.ts'

View File

@@ -1,5 +1,5 @@
import { createRequire, LoadHookContext } from 'node:module'
import { Dict } from 'cosmokit'
import { createRequire, type LoadHookContext } from 'node:module'
import type { Dict } from 'cosmokit'
/** Node internal module format names handled by loader hooks. */
export type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm'