Skip to content

Conversation

@kfirstri
Copy link
Contributor

@kfirstri kfirstri commented Jan 27, 2026

Description

This PR adds auto-detection support for function folders that only contain an index.ts file without a function.jsonc configuration file. Function names are automatically derived from the folder name using kebab-case convention (e.g., MyComplexFunc becomes my-complex-func). This enhancement maintains full backward compatibility with existing function configurations.

Related Issue

Resolves #130

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added readFunctionFromDirectory() function to detect and load functions without config files by scanning for index.ts
  • Updated readAllFunctions() to scan for both configured and auto-detected functions
  • Implemented automatic kebab-case conversion for folder names (e.g., MyComplexFuncmy-complex-func)
  • Added duplicate name detection to prevent conflicts between configured and auto-detected functions
  • Created comprehensive test fixtures covering mixed function types (with and without config files)
  • Added test case reads project with mixed functions to verify the feature works correctly

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The implementation maintains backward compatibility - existing functions with function.json or function.jsonc files continue to work exactly as before. The auto-detection only applies to directories without configuration files. The feature successfully passes all existing and new tests, including lint and type checks.


🤖 Generated by Claude | 2026-01-27 09:35 UTC

Add auto-detection for function folders that contain only index.ts.
The function name is automatically derived from the folder name using kebab-case.

Changes:
- Added readFunctionFromDirectory() to detect functions without config files
- Updated readAllFunctions() to scan for both configured and auto-detected functions
- Added test fixtures and test case for mixed function types
- Maintains backward compatibility with existing function.json/jsonc files

Resolves #130

Co-authored-by: Kfir Stri <[email protected]>
@github-actions
Copy link
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/[email protected]

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/[email protected]"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/[email protected]"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Jan 27, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: support function folders without a function.jsonc file

2 participants