Use explicit ts specifiers for declarations

Restore explicit .ts relative specifiers in source and enable rewriteRelativeImportExtensions so emitted JS uses .js while declarations keep explicit .ts specifiers. Add a NodeNext declaration-consumer gate to prevent extensionless declaration regressions.
This commit is contained in:
Tianyi Cui
2026-06-22 06:11:00 +08:00
parent 94e7355449
commit 07f4047ff0
56 changed files with 323 additions and 147 deletions

View File

@@ -1,9 +1,9 @@
import { Context, Fiber, Inject } from 'cordis'
import { deepEqual, isNullable } from 'cosmokit'
import { Loader } from '../index'
import { EntryGroup } from './group'
import { EntryTree } from './tree'
import { evaluate, interpolate } from './utils'
import { Loader } from '../index.ts'
import { EntryGroup } from './group.ts'
import { EntryTree } from './tree.ts'
import { evaluate, interpolate } from './utils.ts'
/** Serialized plugin entry options stored in loader config files. */
export interface EntryOptions {

View File

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

View File

@@ -1,8 +1,8 @@
import { Context } from 'cordis'
import { Dict } from 'cosmokit'
import { Entry } from './entry'
import { Entry } from './entry.ts'
declare module './entry' {
declare module './entry.ts' {
interface EntryOptions {
intercept?: Dict | null
isolate?: Dict<true | string> | null

View File

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

View File

@@ -1,22 +1,22 @@
import { Context, Inject, Service } from 'cordis'
import { defineProperty, Dict, isNullable } from 'cosmokit'
import { ModuleLoader } from './internal'
import { Entry, EntryOptions } from './config/entry'
import isolate from './config/isolate'
import { EntryTree } from './config/tree'
import { ModuleLoader } from './internal.ts'
import { Entry, EntryOptions } from './config/entry.ts'
import isolate from './config/isolate.ts'
import { EntryTree } from './config/tree.ts'
/** Re-export entry node APIs. */
export * from './config/entry'
export * from './config/entry.ts'
/** Re-export nested entry group APIs. */
export * from './config/group'
export * from './config/group.ts'
/** Re-export service isolation helpers. */
export * from './config/isolate'
export * from './config/isolate.ts'
/** Re-export entry tree persistence APIs. */
export * from './config/tree'
export * from './config/tree.ts'
/** Re-export loader config expression helpers. */
export * from './config/utils'
export * from './config/utils.ts'
/** Re-export Node internal module loader compatibility types. */
export * from './internal'
export * from './internal.ts'
declare module 'cordis' {
interface Events {