SIGN IN SIGN UP

feat(functions): support subsequent installs and multi-project configuration for function kits (#10931)

* feat(functions): add instances on for 2+ installs of the same package

* Remove check for multiple kits

We should assume there is at most one kit containing the package to install.

* Simplify constructing instance config

* Update prompts and logs to match design doc

* simplify adding kit instance to config and remove synthetic test

Simplifies the instance assignment logic in `functions:kits:install` by directly updating `existingKit.instances` in place instead of performing a redundant search and defensive error check over `configSrc.functions`. Removes the synthetic unit test that artificially zeroed out config mid-execution to hit the unreachable error branch.

* refactor: simplify project env checks for function kits install

- Adds `hasProjectEnv(dir, projectId, projectAlias)` to `src/functions/env.ts` as a generic helper to check for `.env.<projectId>` and `.env.<projectAlias>` in a directory.
- Renames `hasDotenvForProject` in `functions-kits-install.ts` to `isKitConfiguredForProject` and delegates directory checks to `hasProjectEnv`.
- Eliminates custom `getProjectIdentifiers` resolution and `readdirSync` directory itøeration, aligning with how the CLI resolves environment files.

* Simplify functions config validation

* refactor: split install logic into helper functions

* Explicitly check prompts in multiple instance configuration

* Output log with instance id placeholder for promptExistingInstanceForProject non-interactive
W
Wanda Mora committed
414cc029dba66510327f8287716edf91536acd6a
Parent: 21a5b75
Committed by GitHub <noreply@github.com> on 8/18/2026, 12:54:35 AM