Motivation
If the template has a public/index.html, then try to make the following changes:
Update the title of the app to the name of the app. Example:
If the template has a a public/manifest.json, modify the short_name and name fields:
"short_name": "My App",
"name": "My App",
Proposal
The locations where these things need to be changed could be made dynamic using a .graasprc file in the template repository. Similar to the way that we delete files listed in a .graaspignore file.
Steps:
- Read a
.graasprc file in the template repository.
- This file would have a key like:
{
"replace": [
{
"location": "public/index.html",
"from": "<title>Graasp App Starter</title>",
"to": "<title>{{APP_NAME}}</title>"
},
{
"location": "*.js",
"from": "$MY_ENV_VAR",
"to": "{{APP_SPECIFIC_ENV_VAR}}"
},
]
}
As shown above, we could have the replacement strategy access variables set by the user in the CLI. Whether we use {{ or something else can be also configurable within the same .graasprc, to adapt to the different templates.
Motivation
If the template has a
public/index.html, then try to make the following changes:Update the title of the app to the name of the app. Example:
If the template has a a
public/manifest.json, modify theshort_nameandnamefields:Proposal
The locations where these things need to be changed could be made dynamic using a
.graasprcfile in the template repository. Similar to the way that we delete files listed in a.graaspignorefile.Steps:
.graasprcfile in the template repository.{ "replace": [ { "location": "public/index.html", "from": "<title>Graasp App Starter</title>", "to": "<title>{{APP_NAME}}</title>" }, { "location": "*.js", "from": "$MY_ENV_VAR", "to": "{{APP_SPECIFIC_ENV_VAR}}" }, ] }As shown above, we could have the replacement strategy access variables set by the user in the CLI. Whether we use
{{or something else can be also configurable within the same.graasprc, to adapt to the different templates.