[ ] PR title descriptive (can be used in release notes)
Description
Create new env-replace workspace used to manage utility methods for future template file replacement
Add core replaceFiles method used to rewrite .template files using global environment variables
Add basic testing suite and tests
Dev Notes
Whilst drafting a PR to populate android and ios template files I realised the code was quickly becoming unmanageable as there are various combinations of files to convert at different times with variables read from multiple places (e.g. Android config has about 5 file replacements but some need to leave templated strings in whilst others need to replace).
To reduce complexity I've moved the core replacement utility into its own workspace, and will make a follow-up pr to call specific methods from it as required.
The utility is designed to support various folder and filename search and exclusion patterns, as well as variable names to include/exclude. See full list of configuration variables included and test cases for more details.
Rough next steps would be
[x] Update deployment config to provide core variables for use in local development (e.g. APP_ID is currently is only populated using github actions, but to run scripts locally would ideally want the id as part of the deployment android config)
[x] Replace all hardcoded config files with templates for android, ios, capacitor and firebase configs
[x] Add workflows to run selective template replacements as required. E.g. yarn workflow android setup could be used to update all android config files and replace variables such as the appId and versionCode from templates. It could also trigger related workflows such as processing assets.
[x] Update github actions to call workflows as required when preparing CI builds
Review Notes
Test suite can be run via
yarn workspace @idemsInternational/env-replace test
Git Issues
Closes #
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes
PR Checklist
Description
env-replace
workspace used to manage utility methods for future template file replacementreplaceFiles
method used to rewrite.template
files using global environment variablesDev Notes
Whilst drafting a PR to populate android and ios template files I realised the code was quickly becoming unmanageable as there are various combinations of files to convert at different times with variables read from multiple places (e.g. Android config has about 5 file replacements but some need to leave templated strings in whilst others need to replace).
To reduce complexity I've moved the core replacement utility into its own workspace, and will make a follow-up pr to call specific methods from it as required.
The utility is designed to support various folder and filename search and exclusion patterns, as well as variable names to include/exclude. See full list of configuration variables included and test cases for more details.
Rough next steps would be
yarn workflow android setup
could be used to update all android config files and replace variables such as the appId and versionCode from templates. It could also trigger related workflows such as processing assets.Review Notes
Test suite can be run via
Git Issues
Closes #
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes