File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ Deno.test("built npm package loads in node through the published ESM entrypoint"
5050 dependencies ?: Record < string , string > ;
5151 devDependencies ?: Record < string , string > ;
5252 } ;
53+ const builtConfig = await Deno . readTextFile (
54+ join ( workspacePath , "dist/esm/src/config.js" ) ,
55+ ) ;
5356 assertEquals (
5457 builtPackage . dependencies ?. cosmiconfig ,
5558 "^9.0.0" ,
@@ -60,6 +63,11 @@ Deno.test("built npm package loads in node through the published ESM entrypoint"
6063 "string" ,
6164 "generated npm package must declare Node typings for dnt typecheck" ,
6265 ) ;
66+ assertEquals (
67+ builtConfig . includes ( "import-meta-ponyfill-esmodule" ) ,
68+ false ,
69+ "generated config loader should not depend on DNT import-meta ponyfill" ,
70+ ) ;
6371
6472 const tempDir = await Deno . makeTempDir ( ) ;
6573 try {
Original file line number Diff line number Diff line change 11import os from "node:os" ;
22import { createRequire } from "node:module" ;
33import { join } from "node:path" ;
4+ import process from "node:process" ;
45import { redactEndpointUserInfo } from "./services/endpoint-redaction.ts" ;
56import { notifyPluginWarning } from "./services/opencode-warning.ts" ;
67import type { GraphitiConfig , RawGraphitiConfig } from "./types/index.ts" ;
@@ -60,7 +61,9 @@ export interface ConfigExplorerAdapter {
6061
6162type ConfigExplorerFactory = ( ) => ConfigExplorerAdapter ;
6263
63- const nodeRequire = createRequire ( import . meta. url ) ;
64+ const nodeRequire = createRequire (
65+ join ( process . cwd ( ) , "graphiti.config.runtime.cjs" ) ,
66+ ) ;
6467
6568const isRecord = ( value : unknown ) : value is Record < string , unknown > =>
6669 ! ! value && typeof value === "object" && ! Array . isArray ( value ) ;
Original file line number Diff line number Diff line change 11import { createRequire } from "node:module" ;
2+ import { join } from "node:path" ;
23import { pathToFileURL } from "node:url" ;
4+ import process from "node:process" ;
35import manifest from "../../deno.json" with { type : "json" } ;
46import { isAbortError } from "../utils.ts" ;
57import { redactEndpointUserInfo } from "./endpoint-redaction.ts" ;
@@ -26,7 +28,9 @@ type McpRuntimeModules = {
2628 StreamableHTTPClientTransport : McpTransportConstructor ;
2729} ;
2830
29- const nodeRequire = createRequire ( import . meta. url ) ;
31+ const nodeRequire = createRequire (
32+ pathToFileURL ( join ( process . cwd ( ) , "graphiti.runtime.cjs" ) ) . href ,
33+ ) ;
3034let mcpRuntimeModulesPromise : Promise < McpRuntimeModules > | null = null ;
3135
3236const importResolvedModule = async < T > ( specifier : string ) : Promise < T > => {
You can’t perform that action at this time.
0 commit comments