Skip to content

Commit 9c3fe12

Browse files
committed
Add SourceEdit experimental feature and release notes.
1 parent d835f0b commit 9c3fe12

8 files changed

Lines changed: 31 additions & 1 deletion

File tree

doc/ReleaseNotes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
## New in v1.28
22

3+
# Experimental Feature: 'sourceEdit'
4+
New feature that adds an 'edit' subcommand to the 'source' command. This can be used to set an explicit source to be implicit and vice-versa. For example, with this feature you can make the 'winget-font' source an implicit source instead of explicit source.
5+
6+
To enable this feature, add the 'sourceEdit' experimental feature to your settings.
7+
```
8+
"experimentalFeatures": {
9+
"sourceEdit": true
10+
},
11+
```
12+
To use the feature, try `winget source edit winget-font` to set the Explicit state to the default.
13+
314
<!-- Nothing yet! -->

doc/Settings.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,13 @@ This feature enables support for fonts via `winget settings`. The `winget font l
364364
"fonts": true
365365
},
366366
```
367+
368+
### sourceEdit
369+
370+
This feature enables support for additional source command improvements via `winget settings`. The `winget source edit` command will become available with this feature.
371+
372+
```json
373+
"experimentalFeatures": {
374+
"sourceEdit": true
375+
},
376+
```

src/AppInstallerCLICore/Commands/SourceCommand.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ namespace AppInstaller::CLI
342342
void SourceEditCommand::ExecuteInternal(Context& context) const
343343
{
344344
context <<
345+
Workflow::EnsureFeatureEnabled(Settings::ExperimentalFeature::Feature::SourceEdit) <<
345346
Workflow::EnsureRunningAsAdmin <<
346347
Workflow::GetSourceListWithFilter <<
347348
Workflow::EditSources;

src/AppInstallerCLICore/Commands/SourceCommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ namespace AppInstaller::CLI
124124

125125
struct SourceEditCommand final : public Command
126126
{
127-
SourceEditCommand(std::string_view parent) : Command("edit", {}, parent, Settings::TogglePolicy::Policy::AllowedSources) {}
127+
SourceEditCommand(std::string_view parent) : Command("edit", {}, parent, Settings::ExperimentalFeature::Feature::SourceEdit) {}
128128

129129
std::vector<Argument> GetArguments() const override;
130130

src/AppInstallerCommonCore/ExperimentalFeature.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ namespace AppInstaller::Settings
4444
return userSettings.Get<Setting::EFResume>();
4545
case ExperimentalFeature::Feature::Font:
4646
return userSettings.Get<Setting::EFFonts>();
47+
case ExperimentalFeature::Feature::SourceEdit:
48+
return userSettings.Get<Setting::EFSourceEdit>();
4749
default:
4850
THROW_HR(E_UNEXPECTED);
4951
}
@@ -77,6 +79,8 @@ namespace AppInstaller::Settings
7779
return ExperimentalFeature{ "Resume", "resume", "https://aka.ms/winget-settings", Feature::Resume };
7880
case Feature::Font:
7981
return ExperimentalFeature{ "Font", "Font", "https://aka.ms/winget-settings", Feature::Font };
82+
case Feature::SourceEdit:
83+
return ExperimentalFeature{ "Source Editing", "sourceEdit", "https://aka.ms/winget-settings", Feature::SourceEdit };
8084

8185
default:
8286
THROW_HR(E_UNEXPECTED);

src/AppInstallerCommonCore/Public/winget/ExperimentalFeature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace AppInstaller::Settings
2525
DirectMSI = 0x1,
2626
Resume = 0x2,
2727
Font = 0x4,
28+
SourceEdit = 0x8,
2829
Max, // This MUST always be after all experimental features
2930

3031
// Features listed after Max will not be shown with the features command

src/AppInstallerCommonCore/Public/winget/UserSettings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ namespace AppInstaller::Settings
7676
EFDirectMSI,
7777
EFResume,
7878
EFFonts,
79+
EFSourceEdit,
7980
// Telemetry
8081
TelemetryDisable,
8182
// Install behavior
@@ -159,6 +160,7 @@ namespace AppInstaller::Settings
159160
SETTINGMAPPING_SPECIALIZATION(Setting::EFDirectMSI, bool, bool, false, ".experimentalFeatures.directMSI"sv);
160161
SETTINGMAPPING_SPECIALIZATION(Setting::EFResume, bool, bool, false, ".experimentalFeatures.resume"sv);
161162
SETTINGMAPPING_SPECIALIZATION(Setting::EFFonts, bool, bool, false, ".experimentalFeatures.fonts"sv);
163+
SETTINGMAPPING_SPECIALIZATION(Setting::EFSourceEdit, bool, bool, false, ".experimentalFeatures.sourceEdit"sv);
162164
// Telemetry
163165
SETTINGMAPPING_SPECIALIZATION(Setting::TelemetryDisable, bool, bool, false, ".telemetry.disable"sv);
164166
// Install behavior

src/AppInstallerCommonCore/UserSettings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ namespace AppInstaller::Settings
267267
WINGET_VALIDATE_PASS_THROUGH(EFDirectMSI)
268268
WINGET_VALIDATE_PASS_THROUGH(EFResume)
269269
WINGET_VALIDATE_PASS_THROUGH(EFFonts)
270+
WINGET_VALIDATE_PASS_THROUGH(EFSourceEdit)
270271
WINGET_VALIDATE_PASS_THROUGH(AnonymizePathForDisplay)
271272
WINGET_VALIDATE_PASS_THROUGH(TelemetryDisable)
272273
WINGET_VALIDATE_PASS_THROUGH(InteractivityDisable)

0 commit comments

Comments
 (0)