warn about missing <clear /> in nuget config and make description optional (#8281)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -105,15 +105,15 @@ impl ScriptLang {
|
||||
pub fn is_native(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
ScriptLang::Bunnative |
|
||||
ScriptLang::Nativets |
|
||||
ScriptLang::Postgresql |
|
||||
ScriptLang::Mysql |
|
||||
ScriptLang::Graphql |
|
||||
ScriptLang::Snowflake |
|
||||
ScriptLang::Mssql |
|
||||
ScriptLang::Bigquery |
|
||||
ScriptLang::OracleDB
|
||||
ScriptLang::Bunnative
|
||||
| ScriptLang::Nativets
|
||||
| ScriptLang::Postgresql
|
||||
| ScriptLang::Mysql
|
||||
| ScriptLang::Graphql
|
||||
| ScriptLang::Snowflake
|
||||
| ScriptLang::Mssql
|
||||
| ScriptLang::Bigquery
|
||||
| ScriptLang::OracleDB
|
||||
)
|
||||
}
|
||||
|
||||
@@ -459,6 +459,7 @@ pub struct NewScript {
|
||||
pub path: String,
|
||||
pub parent_hash: Option<ScriptHash>,
|
||||
pub summary: String,
|
||||
#[serde(default)]
|
||||
pub description: String,
|
||||
pub content: String,
|
||||
pub schema: Option<Schema>,
|
||||
|
||||
@@ -1038,7 +1038,11 @@
|
||||
{oauths}
|
||||
warning={setting.key === 'base_url' && baseUrlIsFallback
|
||||
? 'Auto-detected from browser — not yet saved'
|
||||
: undefined}
|
||||
: setting.key === 'nuget_config' &&
|
||||
$values['nuget_config'] &&
|
||||
!/<clear\s*\/>/.test($values['nuget_config'])
|
||||
? 'Missing <clear /> in <packageSources>. Without it, default sources (like nuget.org) are merged with your custom sources, which is likely not what you want.'
|
||||
: undefined}
|
||||
/>
|
||||
{/if}
|
||||
{#if quickSetup && category === 'Core' && setting.key === 'base_url'}
|
||||
|
||||
@@ -464,7 +464,8 @@ export const settings: Record<string, Setting[]> = {
|
||||
},
|
||||
{
|
||||
label: 'Nuget Config',
|
||||
description: 'Write a nuget.config file to set custom package sources and credentials',
|
||||
description:
|
||||
'Write a nuget.config file to set custom package sources and credentials. Use <clear /> inside <packageSources> to remove default sources and only use your custom ones',
|
||||
key: 'nuget_config',
|
||||
fieldType: 'codearea',
|
||||
codeAreaLang: 'xml',
|
||||
|
||||
Reference in New Issue
Block a user