feat(sdk): add developer project tooling
docs(rfc): propose SDK developer project tooling feat: rename / docs ci: fix windows gates docs: revert
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Node module customization hook for project-local plugin package names.
|
||||
*
|
||||
* @module @deepseek-ai/dsh-scripts/local-plugin-loader-hooks
|
||||
*/
|
||||
|
||||
import type { ResolveHookContext, ResolveFnOutput } from 'node:module'
|
||||
|
||||
interface HookData {
|
||||
mappings: Readonly<Record<string, string>>
|
||||
}
|
||||
|
||||
let mappings: Readonly<Record<string, string>> = {}
|
||||
|
||||
/** Receive the package-name to source-URL map from the launcher thread. */
|
||||
export function initialize(data: HookData): void {
|
||||
mappings = { ...data.mappings }
|
||||
}
|
||||
|
||||
/** Resolve exact local workspace package names to their TypeScript entry source. */
|
||||
export async function resolve(
|
||||
specifier: string,
|
||||
context: ResolveHookContext,
|
||||
nextResolve: (specifier: string, context: ResolveHookContext) => Promise<ResolveFnOutput>,
|
||||
): Promise<ResolveFnOutput> {
|
||||
return nextResolve(mappings[specifier] ?? specifier, context)
|
||||
}
|
||||
Reference in New Issue
Block a user