Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include options for script configuration #864

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Conversation

pelikhan
Copy link
Member

Introduce the include property to allow glob paths for including additional scripts, enhancing project configuration flexibility. Update related functions to support this new feature.

} else {
let tps = toolsPath
if (!tps?.length) {
tps = [GENAI_ANYJS_GLOB, ...arrayify(runtimeHost.config.include)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accessing 'runtimeHost.config.include' assumes that 'runtimeHost.config' is always defined. Ensure that 'runtimeHost.config' is initialized before accessing its properties to avoid potential runtime errors. 🔍

generated by pr-review-commit runtimeHost_config_access

Copy link

The changes in the pull request include:

  1. Imports Optimization:

    • Added new imports such as uniq, GENAI_ANY_REGEX, runtimeHost, and arrayify for improved functionality.
  2. Enhanced buildProject Function:

    • The toolsPath parameter can now accept both a string and an array of strings, providing more flexibility.
    • Enhanced logic to determine script files by incorporating additional paths from runtimeHost.config.include.
    • Introduced filtering of script files to exclude unwanted files based on GENAI_ANY_REGEX.
    • Ensured uniqueness of script files using the uniq function.
  3. HostConfiguration Interface Update:

    • Added an include property, which is a list of glob paths to scan for genai scripts, enhancing configurability.

The changes look well-structured and focused on improving adaptability and configurability of the tool execution process.

LGTM 🚀

generated by pr-review

} else {
let tps = arrayify(toolsPath)
if (!tps?.length) {
tps = [GENAI_ANYJS_GLOB, ...arrayify(runtimeHost.config.include)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of 'runtimeHost.config.include' assumes that 'runtimeHost.config' is always defined. Ensure that 'runtimeHost.config' is initialized before accessing its properties to avoid runtime errors.

generated by pr-review-commit runtime_dependency

@pelikhan pelikhan merged commit 69bbdcb into main Nov 15, 2024
10 checks passed
@pelikhan pelikhan deleted the configuration-include branch November 15, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant