SIGN IN SIGN UP

feat(functions): add functions:kits:install command (#10900)

* Add kits:install command

* Address GCA comments

- throw error for failing to parse template
- remove redundant ? for options.config.src, it shouldn't be undefined or null

* Update source tree

package.json, tsconfig.json, and .gitignore should live in the root
of the kit, and index.ts will be in /src.

* Few more changes

- Prompt for kit ID
- Update npm shrinkwrap warning
- change FIREBASE_FUNCTION_KIT_REGION param to FUNCTION_KIT_REGION

* Update 3p test

* feat: address review feedback for functions:kits:install

* Rename parsePackageSpecifier to parseNpmPackageSpecifier
* Add validateNpmPackageName to validate npm package format and reject multiple slashes
* Simplify sanitizePackageNameToKitName by removing redundant regex replacement
* Tighten isThirdPartyPackage to strictly match @firebase-functions-kits/ scope
* Make npm-shrinkwrap check independent of package origin and prompt if unshrinkwrapped
* Fix typo in shrinkwrap warning message
* Collect existing codebase and instance IDs upfront to prevent mutation side-effects during validation
* Refactor validateKitInstances to accept Iterable<string> with a default Set and add JSDoc param documentation
* Add rejection and tests for instance ID collisions across multiple kits
* Define FUNCTION_KITS_DIR constant for directory paths
* Update command and option descriptions to use function kit terminology
* Add explanatory comment before configuring wrapper package.json
* Refactor index-kit.ts template to use params namespace import and improve option comments
* Add unit tests for package name validation, RC/tag parsing, scope spoofing, independent shrinkwrap checks, and standalone validateKitInstances

* Generate new kit ids defaults if taken

* Update index-kit.ts template

* Update prompts for 3P and adding instances

* Refactor valiateKitInstances

- Split format validation into `validateKitInstanceId` for single instance ID checking.
- Renamed the collection helper to `validateAndAddKitInstances` to explicitly signal adding validated IDs to the project set.
- Updated `functions:kits:install` prompt validation and tests accordingly.

* formatting
W
Wanda Mora committed
a943b9553ed20e8a3390b302e0439d69ebc440d9
Parent: 9969278
Committed by GitHub <noreply@github.com> on 8/11/2026, 3:54:46 PM