refactor: ts in vendor use extensionless import

This commit is contained in:
imccyu
2026-06-17 23:18:25 +08:00
parent 6f6e0517d4
commit 29e674bfea
8 changed files with 25 additions and 25 deletions

View File

@@ -4,7 +4,7 @@ import { ModuleJob, ModuleLoader, ResolveResult } from '@cordisjs/plugin-loader'
import type { Include } from '@cordisjs/plugin-include'
import { ChokidarOptions, FSWatcher, watch } from 'chokidar'
import { relative, resolve } from 'node:path'
import { handleError } from './error.ts'
import { handleError } from './error'
import type {} from '@cordisjs/plugin-timer'
import { fileURLToPath, pathToFileURL } from 'node:url'
import { createRequire } from 'node:module'

View File

@@ -1,9 +1,9 @@
import { Context, Fiber, Inject } from 'cordis'
import { deepEqual, isNullable } from 'cosmokit'
import { Loader } from '../index.ts'
import { EntryGroup } from './group.ts'
import { EntryTree } from './tree.ts'
import { evaluate, interpolate } from './utils.ts'
import { Loader } from '../index'
import { EntryGroup } from './group'
import { EntryTree } from './tree'
import { evaluate, interpolate } from './utils'
/** 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.ts'
import { EntryTree } from './tree.ts'
import { Entry, EntryOptions } from './entry'
import { EntryTree } from './tree'
/** 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.ts'
import { Entry } from './entry'
declare module './entry.ts' {
declare module './entry' {
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.ts'
import { EntryGroup } from './group.ts'
import { Entry, EntryOptions } from './entry'
import { EntryGroup } from './group'
/** 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.ts'
import { Entry, EntryOptions } from './config/entry.ts'
import isolate from './config/isolate.ts'
import { EntryTree } from './config/tree.ts'
import { ModuleLoader } from './internal'
import { Entry, EntryOptions } from './config/entry'
import isolate from './config/isolate'
import { EntryTree } from './config/tree'
/** Re-export entry node APIs. */
export * from './config/entry.ts'
export * from './config/entry'
/** Re-export nested entry group APIs. */
export * from './config/group.ts'
export * from './config/group'
/** Re-export service isolation helpers. */
export * from './config/isolate.ts'
export * from './config/isolate'
/** Re-export entry tree persistence APIs. */
export * from './config/tree.ts'
export * from './config/tree'
/** Re-export loader config expression helpers. */
export * from './config/utils.ts'
export * from './config/utils'
/** Re-export Node internal module loader compatibility types. */
export * from './internal.ts'
export * from './internal'
declare module 'cordis' {
interface Events {

View File

@@ -1,8 +1,8 @@
import { Message } from 'cordis'
import { ConsoleExporter as Base } from './shared.js'
import { ConsoleExporter as Base } from './shared'
/** Re-export shared console exporter config and base implementation. */
export * from './shared.js'
export * from './shared'
/** Browser console exporter that dispatches to native console methods. */
export class ConsoleExporter extends Base {

View File

@@ -1,10 +1,10 @@
import { Formatter } from 'cordis'
import { inspect } from 'node:util'
import supportsColor from 'supports-color'
import { ConsoleExporter as Base } from './shared.js'
import { ConsoleExporter as Base } from './shared'
/** Re-export shared console exporter config and base implementation. */
export * from './shared.js'
export * from './shared'
const inspectFormatter: Formatter = (value, target) => {
return inspect(value, { colors: !!target.colors, depth: Infinity, compact: true, breakLength: Infinity })