fix: adjust tauri and svelte segments

This commit is contained in:
Noah Springer 2024-11-24 16:24:17 +00:00 committed by Jan De Dobbeleer
parent 4c2f08c726
commit f9c0e25556
4 changed files with 23 additions and 26 deletions

View file

@ -9,11 +9,7 @@ func (s *Svelte) Template() string {
}
func (s *Svelte) Enabled() bool {
if !s.hasNodePackage("svelte") {
return false
}
s.extensions = []string{"package.json"}
s.extensions = []string{"svelte.config.js"}
s.commands = []*cmd{
{
regex: `(?:(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,

View file

@ -13,7 +13,8 @@ func (t *Tauri) Template() string {
}
func (t *Tauri) Enabled() bool {
t.extensions = []string{"package.json"}
t.extensions = []string{"tauri.conf.json"}
t.folders = []string{"src-tauri"}
t.commands = []*cmd{
{
regex: `(?:(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,

View file

@ -25,16 +25,16 @@ import Config from "@site/src/components/Config.js";
## Properties
| Name | Type | Default | Description |
| ---------------------- | :--------: | :------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the svelte version |
| `cache_duration` | `string` | `24h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `extensions` | `[]string` | `angular.json` | allows to override the default list of file extensions to validate |
| `folders` | `[]string` | | allows to override the list of folder names to validate |
| Name | Type | Default | Description |
| ---------------------- | :--------: | :----------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the svelte version |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `files` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `extensions` | `[]string` | `svelte.config.js` | allows to override the default list of file extensions to validate |
| `folders` | `[]string` | | allows to override the list of folder names to validate |
## Template ([info][templates])

View file

@ -25,16 +25,16 @@ import Config from "@site/src/components/Config.js";
## Properties
| Name | Type | Default | Description |
| ---------------------- | :--------: | :------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the tauri version |
| `cache_duration` | `string` | `24h` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `extensions` | `[]string` | `angular.json` | allows to override the default list of file extensions to validate |
| `folders` | `[]string` | | allows to override the list of folder names to validate |
| Name | Type | Default | Description |
| ---------------------- | :--------: | :---------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not |
| `fetch_version` | `boolean` | `true` | fetch the tauri version |
| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` |
| `missing_command_text` | `string` | | text to display when the command is missing |
| `display_mode` | `string` | `files` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> |
| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes |
| `extensions` | `[]string` | `tauri.conf.json` | allows to override the default list of file extensions to validate |
| `folders` | `[]string` | `src-tauri` | allows to override the list of folder names to validate |
## Template ([info][templates])