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:
12
vendor/cordis/src/context.ts
vendored
12
vendor/cordis/src/context.ts
vendored
@@ -1,10 +1,10 @@
|
||||
import { Dict } from 'cosmokit'
|
||||
import { EventsService } from './events'
|
||||
import { LoggerService } from './logger'
|
||||
import { ReflectService } from './reflect'
|
||||
import { InjectKey, RegistryService } from './registry'
|
||||
import { getTraceable, symbols } from './utils'
|
||||
import { Fiber } from './fiber'
|
||||
import { EventsService } from './events.ts'
|
||||
import { LoggerService } from './logger.ts'
|
||||
import { ReflectService } from './reflect.ts'
|
||||
import { InjectKey, RegistryService } from './registry.ts'
|
||||
import { getTraceable, symbols } from './utils.ts'
|
||||
import { Fiber } from './fiber.ts'
|
||||
|
||||
/**
|
||||
* Public shape of a Cordis context.
|
||||
|
||||
8
vendor/cordis/src/events.ts
vendored
8
vendor/cordis/src/events.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { defineProperty, Promisify } from 'cosmokit'
|
||||
import { Context } from './context'
|
||||
import { Fiber, FiberState } from './fiber'
|
||||
import { DisposableList, symbols } from './utils'
|
||||
import { Context } from './context.ts'
|
||||
import { Fiber, FiberState } from './fiber.ts'
|
||||
import { DisposableList, symbols } from './utils.ts'
|
||||
|
||||
/** Return whether an event result should stop a bail-style dispatch. */
|
||||
export function isBailed(value: any) {
|
||||
@@ -25,7 +25,7 @@ export type ThisType<F> = F extends (this: infer T, ...args: any) => any ? T : n
|
||||
*/
|
||||
export type DispatchMode = 'emit' | 'parallel' | 'serial' | 'bail' | 'waterfall'
|
||||
|
||||
declare module './context' {
|
||||
declare module './context.ts' {
|
||||
export interface Context {
|
||||
/* eslint-disable max-len */
|
||||
parallel<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): Promise<void>
|
||||
|
||||
10
vendor/cordis/src/fiber.ts
vendored
10
vendor/cordis/src/fiber.ts
vendored
@@ -1,11 +1,11 @@
|
||||
import { Awaitable, defineProperty, Dict, isNullable } from 'cosmokit'
|
||||
import { Context } from './context'
|
||||
import { Plugin } from './registry'
|
||||
import { buildOuterStack, composeError, DisposableList, getTraceable, isConstructor, isObject, symbols } from './utils'
|
||||
import { Impl } from './reflect'
|
||||
import { Context } from './context.ts'
|
||||
import { Plugin } from './registry.ts'
|
||||
import { buildOuterStack, composeError, DisposableList, getTraceable, isConstructor, isObject, symbols } from './utils.ts'
|
||||
import { Impl } from './reflect.ts'
|
||||
import { StandardSchemaV1 } from '@standard-schema/spec'
|
||||
|
||||
declare module './context' {
|
||||
declare module './context.ts' {
|
||||
export interface Context extends Pick<Fiber, 'effect'> {
|
||||
fiber: Fiber
|
||||
}
|
||||
|
||||
14
vendor/cordis/src/index.ts
vendored
14
vendor/cordis/src/index.ts
vendored
@@ -1,14 +1,14 @@
|
||||
/** Core context type and root context implementation. */
|
||||
export * from './context'
|
||||
export * from './context.ts'
|
||||
/** Event bus, dispatch modes, and event augmentation types. */
|
||||
export * from './events'
|
||||
export * from './events.ts'
|
||||
/** Plugin fiber lifecycle, effects, and config validation helpers. */
|
||||
export * from './fiber'
|
||||
export * from './fiber.ts'
|
||||
/** Logger facade, logger service, message, exporter, and formatting types. */
|
||||
export * from './logger'
|
||||
export * from './logger.ts'
|
||||
/** Plugin registry, dependency injection, and plugin entrypoint types. */
|
||||
export * from './registry'
|
||||
export * from './registry.ts'
|
||||
/** Base service class and service lifecycle symbols. */
|
||||
export * from './service'
|
||||
export * from './service.ts'
|
||||
/** Shared internal helpers used by context, services, and plugin fibers. */
|
||||
export * from './utils'
|
||||
export * from './utils.ts'
|
||||
|
||||
8
vendor/cordis/src/logger.ts
vendored
8
vendor/cordis/src/logger.ts
vendored
@@ -1,9 +1,9 @@
|
||||
import { defineProperty, hyphenate } from 'cosmokit'
|
||||
import { Context } from './context'
|
||||
import { Fiber } from './fiber'
|
||||
import { createCallable, joinPrototype, symbols, Tracker } from './utils'
|
||||
import { Context } from './context.ts'
|
||||
import { Fiber } from './fiber.ts'
|
||||
import { createCallable, joinPrototype, symbols, Tracker } from './utils.ts'
|
||||
|
||||
declare module './context' {
|
||||
declare module './context.ts' {
|
||||
interface Intercept {
|
||||
logger: LoggerService.Intercept
|
||||
}
|
||||
|
||||
8
vendor/cordis/src/reflect.ts
vendored
8
vendor/cordis/src/reflect.ts
vendored
@@ -1,9 +1,9 @@
|
||||
import { defineProperty, Dict, isNullable } from 'cosmokit'
|
||||
import { Context } from './context'
|
||||
import { getTraceable, symbols, withProps } from './utils'
|
||||
import { Fiber, FiberState } from './fiber'
|
||||
import { Context } from './context.ts'
|
||||
import { getTraceable, symbols, withProps } from './utils.ts'
|
||||
import { Fiber, FiberState } from './fiber.ts'
|
||||
|
||||
declare module './context' {
|
||||
declare module './context.ts' {
|
||||
interface Context {
|
||||
get<K extends string & keyof this>(name: K, strict?: boolean): undefined | this[K]
|
||||
get(name: string, strict?: boolean): any
|
||||
|
||||
8
vendor/cordis/src/registry.ts
vendored
8
vendor/cordis/src/registry.ts
vendored
@@ -1,8 +1,8 @@
|
||||
import { defineProperty, Dict } from 'cosmokit'
|
||||
import { StandardSchemaV1 } from '@standard-schema/spec'
|
||||
import { Context } from './context'
|
||||
import { Fiber } from './fiber'
|
||||
import { buildOuterStack, DisposableList, symbols, withProps } from './utils'
|
||||
import { Context } from './context.ts'
|
||||
import { Fiber } from './fiber.ts'
|
||||
import { buildOuterStack, DisposableList, symbols, withProps } from './utils.ts'
|
||||
|
||||
function isApplicable(object: Plugin) {
|
||||
return object && typeof object === 'object' && typeof object.apply === 'function'
|
||||
@@ -140,7 +140,7 @@ type GetPluginConfig<P> =
|
||||
? S
|
||||
: GetPluginParameters<P>[0]
|
||||
|
||||
declare module './context' {
|
||||
declare module './context.ts' {
|
||||
export interface Context {
|
||||
inject(deps: Inject, callback: Plugin.Function<void>): Fiber & PromiseLike<Fiber>
|
||||
plugin<P extends Plugin>(plugin: P, ...args: Spread<GetPluginConfig<P>>): Fiber & PromiseLike<Fiber>
|
||||
|
||||
4
vendor/cordis/src/service.ts
vendored
4
vendor/cordis/src/service.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { defineProperty } from 'cosmokit'
|
||||
import { Context } from './context'
|
||||
import { createCallable, joinPrototype, symbols, Tracker } from './utils'
|
||||
import { Context } from './context.ts'
|
||||
import { createCallable, joinPrototype, symbols, Tracker } from './utils.ts'
|
||||
|
||||
/**
|
||||
* Base class for services that expose a named API on `ctx`.
|
||||
|
||||
2
vendor/cordis/src/utils.ts
vendored
2
vendor/cordis/src/utils.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import { defineProperty } from 'cosmokit'
|
||||
import type { Context, Service } from '.'
|
||||
import type { Context, Service } from './index.ts'
|
||||
|
||||
/** Ordered collection of disposable values with O(1) deletion by value. */
|
||||
export class DisposableList<T extends WeakKey> {
|
||||
|
||||
Reference in New Issue
Block a user