/** * Resolves the path to an *-impl sibling file. * * In the published package the compiled .js file is present, so we use the * explicit extension. In source/dev mode only the .ts file exists, so we * return the extensionless path and let `loadImplModule` resolve it via * Nx's `loadTsFile` (which registers a transpiler that teaches Node's CJS * resolver about the `.ts` extension). */ export declare function resolveImplPath(dir: string, name: string): string; /** * Load an *-impl module by path. * * Compiled `.js` impls (published package) load with a plain `require()`. * Anything else is a TypeScript source file and goes through Nx's * `loadTsFile`, which registers swc-node/ts-node, resolves the extensionless * path to `.ts`, transpiles, and cleans up. * * Why this is needed: Nx 22's `registerPluginTSTranspiler` registered * swc-node for the lifetime of the process, so a bare `require()`/`import()` * of a sibling `.ts` file worked whenever the executor happened to run. Nx 23 * instead loads wrapper files through `loadTsFile`, which registers the * transpiler only for the duration of that one call and cleans up in a * `finally` block. Because the delegation layer loads the impl *lazily* — * inside the executor function, long after the wrapper module finished * loading — no transpiler is registered at that point and the load fails with * `Cannot find module '.../executor-impl'` (extensionless, unresolvable) or * `SyntaxError: Unexpected token` (raw TS parsed as JS). Delegating to * `loadTsFile` re-arms the transpiler for each impl load. */ export declare function loadImplModule(implPath: string): any;