firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 915 forks source link

Refactor: extract template helpers into templates.ts #7361

Closed yuchenshi closed 4 days ago

yuchenshi commented 1 week ago

Description

This makes template file paths all relative to /templates/ and removes a lot of __dirname usages.

It allows source files to be moved around using TypeScript refactoring without breaking template paths.

Note that unlike #7332, moving template files themselves still requires manually updating string literals. (I've considered adding manifest files to templates but gave up since /templates are not in /src.)

Scenarios Tested

See integration tests. Not every change is covered by tests though -- we may have to rely on careful code reviews on others.

Sample Commands

N/A