Skip to content

Comments

feat(functions): zero config#246

Open
dor-chaouat wants to merge 2 commits intomainfrom
functions-zero-config
Open

feat(functions): zero config#246
dor-chaouat wants to merge 2 commits intomainfrom
functions-zero-config

Conversation

@dor-chaouat
Copy link
Contributor

@dor-chaouat dor-chaouat commented Feb 15, 2026

Note

Description

Function directories can now be discovered without a function.json/function.jsonc file. If a subdirectory under the functions directory contains an index.js or index.ts (and no config file), it is automatically treated as a function with default configuration: name = directory name, entry = index file name. Existing config-based discovery is unchanged and both discovery methods are merged, with duplicate-name validation still applied.

Related Issue

None

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 glob pattern */index.{js,ts} to discover function directories with index files
  • Implemented default config generation for functions without function.json/function.jsonc (name from directory, entry from index file)
  • Modified readAllFunctions() to merge config-based and zero-config functions
  • Added filtering logic to prevent duplicate discovery when both config and index exist
  • Imported basename utility for deriving function name from directory path
  • Maintained existing duplicate-name validation across both discovery methods

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (bun run 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

This is a developer experience improvement that removes boilerplate. Functions with simple, convention-based structures no longer need explicit config files. The feature is backwards compatible and does not affect existing functions with config files.


🤖 Generated by Claude | 2026-02-16 15:08 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.32-pr.246.eec21b0

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

npm i "base44@npm:@base44-preview/cli@0.0.32-pr.246.eec21b0"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.32-pr.246.eec21b0"
  }
}

Preview published to npm registry — try new features instantly!

@claude
Copy link

claude bot commented Feb 15, 2026

README check ran. 6 discrepancies found:

  1. Missing commands: connectors push, connectors pull, types generate, and eject (commented out but exists)
  2. Description updates needed:
    • create: Should be "Create a new Base44 project" (not "from a template")
    • logout: Should be "Logout from current device" (not "Sign out and clear stored credentials")
    • link: Should be "Link a local project to a Base44 project (create new or link existing)"
    • deploy: Should be "Deploy all project resources (entities, functions, agents, connectors, and site)"
    • eject: Should be "Download the code for an existing Base44 project"
    • All agent/connector commands need their full descriptions matching the code
  3. Command ordering: Commands should be reordered to match logical grouping (auth, project, resources)

The README command table needs to be updated to accurately reflect all 17 commands available in the CLI.

Copy link
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

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

Just let's do the fix for function name

absolute: true,
});

const name = basename(functionDir);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's kebab case this? Or at least cleanup it to be usable in a url

@claude
Copy link

claude bot commented Feb 16, 2026

README check ran. 6 issues found and applied: added missing commands (eject, connectors pull/push, types generate), updated command descriptions to match code exactly. README.md has been updated in this branch.

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

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants