Closed pelikhan closed 2 days ago
The changes in the pull request branch involve several modifications in the functionality and constants used across multiple TypeScript files. Here is a summary of the changes:
GENAI_JS_GLOB
was replaced with GENAI_ANYJS_GLOB
in several files. The new constant includes a wider range of file types (**/*.genai.{js,mjs,ts,mts}
), which means the system will now work with .ts
and .mts
files in addition to the previously supported .js
and .mjs
files. This expands the range of scripts that can be handled.compileScript
function in scripts.ts
has been expanded to handle both .js
and .ts
files. This includes checking if such files exist in the directory and running appropriate commands to compile them.ast.ts
, the TextFile
class and its related code have been removed. This may impact other parts of the system that rely on this class.JS_REGEX
has been added in constants.ts
, which seems to be used for recognizing .js
files.importPrompt
in importprompt.ts
has seen changes. Specifically, an onImport
function has been added for tracing file imports and a register
function is being imported from the tsx/esm/api
module which is used to register the onImport
function for callbacks.template.ts
, the templateIdFromFileName
function now considers .mts
files in addition to the other types.activateModelCompletionProvider
function in modelcompletionprovider.ts
now uses the GENAI_ANYJS_GLOB
constant, expanding the file types it supports.findScripts
function in state.ts
also now uses the GENAI_ANYJS_GLOB
constant, expanding the file types it can find.Overall, these changes seem to be aimed at expanding the types of scripts that can be handled by the system to include TypeScript files in addition to JavaScript ones. It also includes changes for better tracing of imports.
However, the removal of the TextFile
class and related code in ast.ts
might impact other parts of the system. Ensure that this class is not used elsewhere, or that all its usages have been properly refactored.
LGTM :rocket:
generated by pr-review
GENAI_JS_GLOB
toGENAI_ANYJS_GLOB
to accurately reflect the supported file types (JavaScript and TypeScript).tsconfig.json
files in many directories across the entire project. This configures the TypeScript compiler for each directory, which allows for more targeted settings per directory.Project
class. This might be part of a larger move towards reducing the class's responsibility or could be part of some refactoring work.summarizer-mts.mts
file. This seems like an attempt to test or showcase the new TypeScript support.tsconfig.json
. The bundle prompts now include configuration for the TypeScript compiler.