Browse Source

refactor: ts in vendor use extensionless import

imccyu 4 months ago
parent
commit
29e674bfea

+ 1 - 1
vendor/hmr/src/index.ts

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

+ 4 - 4
vendor/loader/src/config/entry.ts

@@ -1,9 +1,9 @@
 import { Context, Fiber, Inject } from 'cordis'
 import { Context, Fiber, Inject } from 'cordis'
 import { deepEqual, isNullable } from 'cosmokit'
 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. */
 /** Serialized plugin entry options stored in loader config files. */
 export interface EntryOptions {
 export interface EntryOptions {

+ 2 - 2
vendor/loader/src/config/group.ts

@@ -1,6 +1,6 @@
 import { Context, Service } from 'cordis'
 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. */
 /** Runtime owner for a list of child loader entries. */
 export class EntryGroup {
 export class EntryGroup {

+ 2 - 2
vendor/loader/src/config/isolate.ts

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

+ 2 - 2
vendor/loader/src/config/tree.ts

@@ -1,7 +1,7 @@
 import { composeError, Context } from 'cordis'
 import { composeError, Context } from 'cordis'
 import { Dict, isNonNullable } from 'cosmokit'
 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. */
 /** Mutable tree of loader entries. Persistence is supplied by subclasses. */
 export abstract class EntryTree {
 export abstract class EntryTree {

+ 10 - 10
vendor/loader/src/index.ts

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

+ 2 - 2
vendor/logger-console/src/browser.ts

@@ -1,8 +1,8 @@
 import { Message } from 'cordis'
 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. */
 /** 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. */
 /** Browser console exporter that dispatches to native console methods. */
 export class ConsoleExporter extends Base {
 export class ConsoleExporter extends Base {

+ 2 - 2
vendor/logger-console/src/index.ts

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